From 65280c2755610585ca54f9474e1052cc8042ae8d Mon Sep 17 00:00:00 2001 From: mrkelly Date: Thu, 17 Nov 2016 11:07:51 +0800 Subject: [PATCH 1/2] Upgrade KEngine --- KEngine | 2 +- .../Modules/LuaModule/LuaModule.cs | 20 +------------------ slua | 2 +- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/KEngine b/KEngine index 8e4f669d..2e5b17a2 160000 --- a/KEngine +++ b/KEngine @@ -1 +1 @@ -Subproject commit 8e4f669d7085d9c244842e0df7441dd207f15620 +Subproject commit 2e5b17a23f46c7409193a3d0848d3a4ba1208899 diff --git a/KSFramework/Assets/Plugins/KSFramework/Modules/LuaModule/LuaModule.cs b/KSFramework/Assets/Plugins/KSFramework/Modules/LuaModule/LuaModule.cs index 47f2a5dd..abdc87e8 100644 --- a/KSFramework/Assets/Plugins/KSFramework/Modules/LuaModule/LuaModule.cs +++ b/KSFramework/Assets/Plugins/KSFramework/Modules/LuaModule/LuaModule.cs @@ -243,25 +243,7 @@ public IEnumerator Init() [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static public int ImportCSharpType(IntPtr l) { - try - { - string cls; - Helper.checkType(l, 1, out cls); - Type t = LuaObject.FindType(cls); - if (t == null) - { - return Helper.error(l, "Can't find {0} to create", cls); - } - - LuaClassObject co = new LuaClassObject(t); - LuaObject.pushObject(l,co); - Helper.pushValue(l, true); - return 2; - } - catch (Exception e) - { - return Helper.error(l, e); - } + return Helper.GetClass(l); } /// /// same as SLua default import diff --git a/slua b/slua index 697fafce..44f60862 160000 --- a/slua +++ b/slua @@ -1 +1 @@ -Subproject commit 697fafceda1e7aaf2da8d628ae07308815b5ef13 +Subproject commit 44f60862932b5b47d19cd93cd16888fcd1307c04 From 5f08dc709db3bb82fe6231c20c3842d6cf1fbff0 Mon Sep 17 00:00:00 2001 From: mrkelly Date: Thu, 17 Nov 2016 14:46:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?import=5Ftype=E5=87=BD=E6=95=B0bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/LuaModule/LuaModule.cs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/KSFramework/Assets/Plugins/KSFramework/Modules/LuaModule/LuaModule.cs b/KSFramework/Assets/Plugins/KSFramework/Modules/LuaModule/LuaModule.cs index abdc87e8..47f2a5dd 100644 --- a/KSFramework/Assets/Plugins/KSFramework/Modules/LuaModule/LuaModule.cs +++ b/KSFramework/Assets/Plugins/KSFramework/Modules/LuaModule/LuaModule.cs @@ -243,7 +243,25 @@ public IEnumerator Init() [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static public int ImportCSharpType(IntPtr l) { - return Helper.GetClass(l); + try + { + string cls; + Helper.checkType(l, 1, out cls); + Type t = LuaObject.FindType(cls); + if (t == null) + { + return Helper.error(l, "Can't find {0} to create", cls); + } + + LuaClassObject co = new LuaClassObject(t); + LuaObject.pushObject(l,co); + Helper.pushValue(l, true); + return 2; + } + catch (Exception e) + { + return Helper.error(l, e); + } } /// /// same as SLua default import