From 4943ca76b5284b71bfd6883adbe6776e1c6e640e Mon Sep 17 00:00:00 2001 From: zhangqiang <657634622@qq.com> Date: Mon, 1 Mar 2021 17:47:47 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=8A=A5=E9=94=99=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Source/Generate/DelegateFactory.cs | 61 ------------------- Assets/Source/Generate/LuaBinder.cs | 28 --------- .../Generate/UnityEngine_ApplicationWrap.cs | 43 ------------- 3 files changed, 132 deletions(-) diff --git a/Assets/Source/Generate/DelegateFactory.cs b/Assets/Source/Generate/DelegateFactory.cs index 03dcf70179..302ac4d67d 100644 --- a/Assets/Source/Generate/DelegateFactory.cs +++ b/Assets/Source/Generate/DelegateFactory.cs @@ -71,7 +71,6 @@ public class DelegateFactory dict.Add(typeof(UnityEngine.Application.AdvertisingIdentifierCallback), factory.UnityEngine_Application_AdvertisingIdentifierCallback); dict.Add(typeof(UnityEngine.Application.LowMemoryCallback), factory.UnityEngine_Application_LowMemoryCallback); dict.Add(typeof(UnityEngine.Application.LogCallback), factory.UnityEngine_Application_LogCallback); - dict.Add(typeof(System.Action), factory.System_Action_bool); dict.Add(typeof(System.Func), factory.System_Func_bool); dict.Add(typeof(UnityEngine.AudioClip.PCMReaderCallback), factory.UnityEngine_AudioClip_PCMReaderCallback); dict.Add(typeof(UnityEngine.AudioClip.PCMSetPositionCallback), factory.UnityEngine_AudioClip_PCMSetPositionCallback); @@ -154,7 +153,6 @@ public class DelegateFactory DelegateTraits.Init(factory.UnityEngine_Application_AdvertisingIdentifierCallback); DelegateTraits.Init(factory.UnityEngine_Application_LowMemoryCallback); DelegateTraits.Init(factory.UnityEngine_Application_LogCallback); - DelegateTraits>.Init(factory.System_Action_bool); DelegateTraits>.Init(factory.System_Func_bool); DelegateTraits.Init(factory.UnityEngine_AudioClip_PCMReaderCallback); DelegateTraits.Init(factory.UnityEngine_AudioClip_PCMSetPositionCallback); @@ -237,7 +235,6 @@ public class DelegateFactory TypeTraits.Init(factory.Check_UnityEngine_Application_AdvertisingIdentifierCallback); TypeTraits.Init(factory.Check_UnityEngine_Application_LowMemoryCallback); TypeTraits.Init(factory.Check_UnityEngine_Application_LogCallback); - TypeTraits>.Init(factory.Check_System_Action_bool); TypeTraits>.Init(factory.Check_System_Func_bool); TypeTraits.Init(factory.Check_UnityEngine_AudioClip_PCMReaderCallback); TypeTraits.Init(factory.Check_UnityEngine_AudioClip_PCMSetPositionCallback); @@ -320,7 +317,6 @@ public class DelegateFactory StackTraits.Push = factory.Push_UnityEngine_Application_AdvertisingIdentifierCallback; StackTraits.Push = factory.Push_UnityEngine_Application_LowMemoryCallback; StackTraits.Push = factory.Push_UnityEngine_Application_LogCallback; - StackTraits>.Push = factory.Push_System_Action_bool; StackTraits>.Push = factory.Push_System_Func_bool; StackTraits.Push = factory.Push_UnityEngine_AudioClip_PCMReaderCallback; StackTraits.Push = factory.Push_UnityEngine_AudioClip_PCMSetPositionCallback; @@ -3587,63 +3583,6 @@ public class DelegateFactory ToLua.Push(L, o); } - class System_Action_bool_Event : LuaDelegate - { - public System_Action_bool_Event(LuaFunction func) : base(func) { } - public System_Action_bool_Event(LuaFunction func, LuaTable self) : base(func, self) { } - - public void Call(bool param0) - { - func.BeginPCall(); - func.Push(param0); - func.PCall(); - func.EndPCall(); - } - - public void CallWithSelf(bool param0) - { - func.BeginPCall(); - func.Push(self); - func.Push(param0); - func.PCall(); - func.EndPCall(); - } - } - - public System.Action System_Action_bool(LuaFunction func, LuaTable self, bool flag) - { - if (func == null) - { - System.Action fn = delegate(bool param0) { }; - return fn; - } - - if(!flag) - { - System_Action_bool_Event target = new System_Action_bool_Event(func); - System.Action d = target.Call; - target.method = d.Method; - return d; - } - else - { - System_Action_bool_Event target = new System_Action_bool_Event(func, self); - System.Action d = target.CallWithSelf; - target.method = d.Method; - return d; - } - } - - bool Check_System_Action_bool(IntPtr L, int pos) - { - return TypeChecker.CheckDelegateType(typeof(System.Action), L, pos); - } - - void Push_System_Action_bool(IntPtr L, System.Action o) - { - ToLua.Push(L, o); - } - class System_Func_bool_Event : LuaDelegate { public System_Func_bool_Event(LuaFunction func) : base(func) { } diff --git a/Assets/Source/Generate/LuaBinder.cs b/Assets/Source/Generate/LuaBinder.cs index 4f6cb86f57..326d772df9 100644 --- a/Assets/Source/Generate/LuaBinder.cs +++ b/Assets/Source/Generate/LuaBinder.cs @@ -386,7 +386,6 @@ public static class LuaBinder L.RegFunction("Action_int", System_Action_int); L.RegFunction("Comparison_int", System_Comparison_int); L.RegFunction("Func_int_int", System_Func_int_int); - L.RegFunction("Action_bool", System_Action_bool); L.RegFunction("Func_bool", System_Func_bool); L.RegFunction("Action_UnityEngine_AsyncOperation", System_Action_UnityEngine_AsyncOperation); L.RegFunction("Action_string", System_Action_string); @@ -2411,33 +2410,6 @@ public static class LuaBinder } } - [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] - static int System_Action_bool(IntPtr L) - { - try - { - int count = LuaDLL.lua_gettop(L); - LuaFunction func = ToLua.CheckLuaFunction(L, 1); - - if (count == 1) - { - Delegate arg1 = DelegateTraits>.Create(func); - ToLua.Push(L, arg1); - } - else - { - LuaTable self = ToLua.CheckLuaTable(L, 2); - Delegate arg1 = DelegateTraits>.Create(func, self); - ToLua.Push(L, arg1); - } - return 1; - } - catch(Exception e) - { - return LuaDLL.toluaL_exception(L, e); - } - } - [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int System_Func_bool(IntPtr L) { diff --git a/Assets/Source/Generate/UnityEngine_ApplicationWrap.cs b/Assets/Source/Generate/UnityEngine_ApplicationWrap.cs index 8e6aedd8cf..8bb8a9fe63 100644 --- a/Assets/Source/Generate/UnityEngine_ApplicationWrap.cs +++ b/Assets/Source/Generate/UnityEngine_ApplicationWrap.cs @@ -54,7 +54,6 @@ public class UnityEngine_ApplicationWrap L.RegVar("logMessageReceived", get_logMessageReceived, set_logMessageReceived); L.RegVar("logMessageReceivedThreaded", get_logMessageReceivedThreaded, set_logMessageReceivedThreaded); L.RegVar("onBeforeRender", get_onBeforeRender, set_onBeforeRender); - L.RegVar("focusChanged", get_focusChanged, set_focusChanged); L.RegVar("wantsToQuit", get_wantsToQuit, set_wantsToQuit); L.RegVar("quitting", get_quitting, set_quitting); L.RegFunction("AdvertisingIdentifierCallback", UnityEngine_Application_AdvertisingIdentifierCallback); @@ -753,13 +752,6 @@ public class UnityEngine_ApplicationWrap return 1; } - [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] - static int get_focusChanged(IntPtr L) - { - ToLua.Push(L, new EventObject(typeof(System.Action))); - return 1; - } - [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int get_wantsToQuit(IntPtr L) { @@ -959,41 +951,6 @@ public class UnityEngine_ApplicationWrap } } - [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] - static int set_focusChanged(IntPtr L) - { - try - { - EventObject arg0 = null; - - if (LuaDLL.lua_isuserdata(L, 2) != 0) - { - arg0 = (EventObject)ToLua.ToObject(L, 2); - } - else - { - return LuaDLL.luaL_throw(L, "The event 'UnityEngine.Application.focusChanged' can only appear on the left hand side of += or -= when used outside of the type 'UnityEngine.Application'"); - } - - if (arg0.op == EventOp.Add) - { - System.Action ev = (System.Action)arg0.func; - UnityEngine.Application.focusChanged += ev; - } - else if (arg0.op == EventOp.Sub) - { - System.Action ev = (System.Action)arg0.func; - UnityEngine.Application.focusChanged -= ev; - } - - return 0; - } - catch (Exception e) - { - return LuaDLL.toluaL_exception(L, e); - } - } - [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int set_wantsToQuit(IntPtr L) {