更新Xlua 到最新版本
This commit is contained in:
Assets
Plugins
Android.metaWSA.meta
XLua.metaAndroid
libs
IOS
Script
AssetUpdate
WSA
WebGL.metaWebGL
arm64.metaarm64
x86.metaXLua
CHANGELOG.txtCHANGELOG.txt.meta
Doc
Configure_EN.mdHotfix_EN.md
Editor.metaMaterials
XLua_API.mdXLua教程.mdcompatible_bytecode.mdconfigure.mdcustom_generate.mdfaq.mdfeatures.mdhotfix.mdlogo.png.metaxLua.pngxLua.png.metaEditor
ExampleConfig.csExampleConfig.cs.metaXLuaGenConfig.csXLuaUnityDefaultConfig.csXLuaUnityDefaultConfig.cs.meta
Gen.metaGen
DelegatesGensBridge.csDelegatesGensBridge.cs.metaEnumWrap.csEnumWrap.cs.metaIMarketingActRetDelBridge.cs.metaLuaMainWrap.cs.metaLuaUIBehaviourWrap.cs.metaPackUnpack.cs.metaSdkControlWrap.csSdkControlWrap.cs.metaSystem_Collections_Generic_List_1_System_Int32_Wrap.cs.metaSystem_Collections_HashtableWrap.cs.metaSystem_Collections_IEnumerableBridge.cs.metaSystem_Collections_IEnumeratorBridge.cs.metaSystem_ObjectWrap.cs.metaTableManagerLuaWrap.cs.metaTutorial_BaseClassWrap.csTutorial_BaseClassWrap.cs.metaTutorial_CSCallLua_ItfDBridge.csTutorial_CSCallLua_ItfDBridge.cs.metaTutorial_DerivedClassExtensionsWrap.csTutorial_DerivedClassExtensionsWrap.cs.metaTutorial_DerivedClassWrap.csTutorial_DerivedClassWrap.cs.metaTutorial_ICalcWrap.csTutorial_ICalcWrap.cs.metaUnityEngine_AnimationClipWrap.cs.metaUnityEngine_AnimationCurveWrap.cs.metaUnityEngine_BehaviourWrap.cs.metaUnityEngine_BoundsWrap.cs.metaUnityEngine_ColorWrap.cs.metaUnityEngine_ComponentWrap.cs.metaUnityEngine_DebugWrap.cs.metaUnityEngine_GameObjectWrap.cs.metaUnityEngine_KeyframeWrap.cs.metaUnityEngine_LightWrap.cs.metaUnityEngine_MathfWrap.cs.metaUnityEngine_MonoBehaviourWrap.cs.metaUnityEngine_ObjectWrap.cs.metaUnityEngine_ParticleSystemWrap.cs.metaUnityEngine_QuaternionWrap.cs.metaUnityEngine_Ray2DWrap.cs.metaUnityEngine_RayWrap.cs.metaUnityEngine_RendererWrap.cs.metaUnityEngine_ResourcesWrap.cs.metaUnityEngine_SkinnedMeshRendererWrap.cs.metaUnityEngine_TextAssetWrap.cs.metaUnityEngine_TimeWrap.cs.metaUnityEngine_TransformWrap.cs.metaUnityEngine_Vector2Wrap.cs.metaUnityEngine_Vector3Wrap.cs.metaUnityEngine_Vector4Wrap.cs.metaUnityEngine_WWWWrap.cs.metaWrapPusher.csWrapPusher.cs.metaXLuaGenAutoRegister.csXLuaGenAutoRegister.cs.metalink.xmllink.xml.meta
Resources
Src.metaSrc
CodeEmit.csCodeEmit.cs.metaCopyByValue.csCopyByValue.cs.metaDelegateBridge.csDelegateBridge.cs.metaEditor.meta
Tutorial.metaEditor
Generator.csGenerator.cs.metaHotfix.csHotfix.cs.metaLinkXmlGen.meta
GenAttributes.csGenAttributes.cs.metaGenericDelegateBridge.csGenericDelegateBridge.cs.metaInternalGlobals.csInternalGlobals.cs.metaLuaBase.csLuaBase.cs.metaLuaDLL.csLuaDLL.cs.metaLuaEnv.csLuaEnv.cs.metaLuaException.csLuaException.cs.metaLuaFunction.csLuaFunction.cs.metaLuaTable.csLuaTable.cs.metaMethodWarpsCache.csMethodWarpsCache.cs.metaObjectCasters.csObjectCasters.cs.metaObjectPool.csObjectPool.cs.metaObjectTranslator.csObjectTranslator.cs.metaObjectTranslatorPool.csObjectTranslatorPool.cs.metaRawObject.csRawObject.cs.metaSignatureLoader.csSignatureLoader.cs.metaStaticLuaCallbacks.csStaticLuaCallbacks.cs.metaTemplateEngine.metaLinkXmlGen
Report.csReport.cs.metaTemplate.metaTemplate
LuaClassWrap.tpl.txtLuaClassWrap.tpl.txt.metaLuaClassWrapGCM.tpl.txtLuaClassWrapGCM.tpl.txt.metaLuaDelegateBridge.tpl.txtLuaDelegateBridge.tpl.txt.metaLuaDelegateWrap.tpl.txtLuaDelegateWrap.tpl.txt.metaLuaEnumWrap.tpl.txtLuaEnumWrap.tpl.txt.metaLuaEnumWrapGCM.tpl.txtLuaEnumWrapGCM.tpl.txt.metaLuaInterfaceBridge.tpl.txtLuaInterfaceBridge.tpl.txt.metaLuaRegister.tpl.txtLuaRegister.tpl.txt.metaLuaRegisterGCM.tpl.txtLuaRegisterGCM.tpl.txt.metaLuaWrapPusher.tpl.txtLuaWrapPusher.tpl.txt.metaPackUnpack.tpl.txtPackUnpack.tpl.txt.metaTemplateCommon.lua.txtTemplateCommon.lua.txt.meta
TemplateRef.csTemplateRef.cs.metaTemplateEngine
TypeExtensions.csTypeExtensions.cs.metaUtils.csUtils.cs.metaTutorial
CSharpCallLua.meta
CSharpCallLua
LoadLuaScript.metaLoadLuaScript
ByFile.meta
LuaCallCSharp.metaByFile
ByString.metaByString
Loader.metaLoader
LuaCallCSharp
@ -16,161 +16,7 @@ namespace XLua
|
||||
public partial class DelegateBridge : DelegateBridgeBase
|
||||
{
|
||||
|
||||
public void __Gen_Delegate_Imp0()
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
{
|
||||
#endif
|
||||
RealStatePtr L = luaEnv.rawL;
|
||||
int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
|
||||
|
||||
|
||||
PCall(L, 0, 0, errFunc);
|
||||
|
||||
|
||||
|
||||
LuaAPI.lua_settop(L, errFunc - 1);
|
||||
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public double __Gen_Delegate_Imp1(double p0, double p1)
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
{
|
||||
#endif
|
||||
RealStatePtr L = luaEnv.rawL;
|
||||
int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
|
||||
|
||||
LuaAPI.lua_pushnumber(L, p0);
|
||||
LuaAPI.lua_pushnumber(L, p1);
|
||||
|
||||
PCall(L, 2, 1, errFunc);
|
||||
|
||||
|
||||
double __gen_ret = LuaAPI.lua_tonumber(L, errFunc + 1);
|
||||
LuaAPI.lua_settop(L, errFunc - 1);
|
||||
return __gen_ret;
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public void __Gen_Delegate_Imp2(string p0)
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
{
|
||||
#endif
|
||||
RealStatePtr L = luaEnv.rawL;
|
||||
int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
|
||||
|
||||
LuaAPI.lua_pushstring(L, p0);
|
||||
|
||||
PCall(L, 1, 0, errFunc);
|
||||
|
||||
|
||||
|
||||
LuaAPI.lua_settop(L, errFunc - 1);
|
||||
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public void __Gen_Delegate_Imp3(double p0)
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
{
|
||||
#endif
|
||||
RealStatePtr L = luaEnv.rawL;
|
||||
int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
|
||||
|
||||
LuaAPI.lua_pushnumber(L, p0);
|
||||
|
||||
PCall(L, 1, 0, errFunc);
|
||||
|
||||
|
||||
|
||||
LuaAPI.lua_settop(L, errFunc - 1);
|
||||
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public void __Gen_Delegate_Imp4(object p0)
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
{
|
||||
#endif
|
||||
RealStatePtr L = luaEnv.rawL;
|
||||
int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
|
||||
ObjectTranslator translator = luaEnv.translator;
|
||||
translator.PushAny(L, p0);
|
||||
|
||||
PCall(L, 1, 0, errFunc);
|
||||
|
||||
|
||||
|
||||
LuaAPI.lua_settop(L, errFunc - 1);
|
||||
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public void __Gen_Delegate_Imp5(LuaUIItemBase p0)
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
{
|
||||
#endif
|
||||
RealStatePtr L = luaEnv.rawL;
|
||||
int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
|
||||
ObjectTranslator translator = luaEnv.translator;
|
||||
translator.Push(L, p0);
|
||||
|
||||
PCall(L, 1, 0, errFunc);
|
||||
|
||||
|
||||
|
||||
LuaAPI.lua_settop(L, errFunc - 1);
|
||||
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public void __Gen_Delegate_Imp6(LuaUIItemSelect p0)
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
{
|
||||
#endif
|
||||
RealStatePtr L = luaEnv.rawL;
|
||||
int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
|
||||
ObjectTranslator translator = luaEnv.translator;
|
||||
translator.Push(L, p0);
|
||||
|
||||
PCall(L, 1, 0, errFunc);
|
||||
|
||||
|
||||
|
||||
LuaAPI.lua_settop(L, errFunc - 1);
|
||||
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public void __Gen_Delegate_Imp7(bool p0, object p1, UnityEngine.GameObject p2)
|
||||
public void __Gen_Delegate_Imp0(bool p0, object p1, UnityEngine.GameObject p2)
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
@ -194,7 +40,7 @@ namespace XLua
|
||||
#endif
|
||||
}
|
||||
|
||||
public void __Gen_Delegate_Imp8(bool p0, object p1)
|
||||
public int __Gen_Delegate_Imp1(int p0, string p1, out Tutorial.CSCallLua.DClass p2)
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
@ -203,15 +49,37 @@ namespace XLua
|
||||
RealStatePtr L = luaEnv.rawL;
|
||||
int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
|
||||
ObjectTranslator translator = luaEnv.translator;
|
||||
LuaAPI.lua_pushboolean(L, p0);
|
||||
translator.PushAny(L, p1);
|
||||
|
||||
PCall(L, 2, 0, errFunc);
|
||||
LuaAPI.xlua_pushinteger(L, p0);
|
||||
LuaAPI.lua_pushstring(L, p1);
|
||||
|
||||
PCall(L, 2, 2, errFunc);
|
||||
|
||||
p2 = (Tutorial.CSCallLua.DClass)translator.GetObject(L, errFunc + 2, typeof(Tutorial.CSCallLua.DClass));
|
||||
|
||||
int __gen_ret = LuaAPI.xlua_tointeger(L, errFunc + 1);
|
||||
LuaAPI.lua_settop(L, errFunc - 1);
|
||||
return __gen_ret;
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public System.Action __Gen_Delegate_Imp2()
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
{
|
||||
#endif
|
||||
RealStatePtr L = luaEnv.rawL;
|
||||
int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
|
||||
ObjectTranslator translator = luaEnv.translator;
|
||||
|
||||
PCall(L, 0, 1, errFunc);
|
||||
|
||||
|
||||
System.Action __gen_ret = translator.GetDelegate<System.Action>(L, errFunc + 1);
|
||||
LuaAPI.lua_settop(L, errFunc - 1);
|
||||
return __gen_ret;
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
}
|
||||
#endif
|
||||
@ -226,59 +94,19 @@ namespace XLua
|
||||
public override Delegate GetDelegateByType(Type type)
|
||||
{
|
||||
|
||||
if (type == typeof(System.Action))
|
||||
{
|
||||
return new System.Action(__Gen_Delegate_Imp0);
|
||||
}
|
||||
|
||||
if (type == typeof(UnityEngine.Events.UnityAction))
|
||||
{
|
||||
return new UnityEngine.Events.UnityAction(__Gen_Delegate_Imp0);
|
||||
}
|
||||
|
||||
if (type == typeof(System.Func<double, double, double>))
|
||||
{
|
||||
return new System.Func<double, double, double>(__Gen_Delegate_Imp1);
|
||||
}
|
||||
|
||||
if (type == typeof(System.Action<string>))
|
||||
{
|
||||
return new System.Action<string>(__Gen_Delegate_Imp2);
|
||||
}
|
||||
|
||||
if (type == typeof(System.Action<double>))
|
||||
{
|
||||
return new System.Action<double>(__Gen_Delegate_Imp3);
|
||||
}
|
||||
|
||||
if (type == typeof(LuaUIItemBase.voidObject))
|
||||
{
|
||||
return new LuaUIItemBase.voidObject(__Gen_Delegate_Imp4);
|
||||
}
|
||||
|
||||
if (type == typeof(LuaUIItemSelect.voidObject))
|
||||
{
|
||||
return new LuaUIItemSelect.voidObject(__Gen_Delegate_Imp4);
|
||||
}
|
||||
|
||||
if (type == typeof(LuaUIItemBase.voidLuaUIItemBase))
|
||||
{
|
||||
return new LuaUIItemBase.voidLuaUIItemBase(__Gen_Delegate_Imp5);
|
||||
}
|
||||
|
||||
if (type == typeof(LuaUIItemSelect.voidLuaUIItemSelect))
|
||||
{
|
||||
return new LuaUIItemSelect.voidLuaUIItemSelect(__Gen_Delegate_Imp6);
|
||||
}
|
||||
|
||||
if (type == typeof(LuaUIManager.OnOpenUIDelegate))
|
||||
{
|
||||
return new LuaUIManager.OnOpenUIDelegate(__Gen_Delegate_Imp7);
|
||||
return new LuaUIManager.OnOpenUIDelegate(__Gen_Delegate_Imp0);
|
||||
}
|
||||
|
||||
if (type == typeof(UIManager.OnOpenUIDelegate))
|
||||
if (type == typeof(Tutorial.CSCallLua.FDelegate))
|
||||
{
|
||||
return new UIManager.OnOpenUIDelegate(__Gen_Delegate_Imp8);
|
||||
return new Tutorial.CSCallLua.FDelegate(__Gen_Delegate_Imp1);
|
||||
}
|
||||
|
||||
if (type == typeof(Tutorial.CSCallLua.GetE))
|
||||
{
|
||||
return new Tutorial.CSCallLua.GetE(__Gen_Delegate_Imp2);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4797b480e17a1c041baaf6c27a2faa7b
|
||||
guid: 3aa587e201b3ae240870ab706192726f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -16,4 +16,120 @@ namespace XLua.CSObjectWrap
|
||||
{
|
||||
using Utils = XLua.Utils;
|
||||
|
||||
public class TutorialTestEnumWrap
|
||||
{
|
||||
public static void __Register(RealStatePtr L)
|
||||
{
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
Utils.BeginObjectRegister(typeof(Tutorial.TestEnum), L, translator, 0, 0, 0, 0);
|
||||
Utils.EndObjectRegister(typeof(Tutorial.TestEnum), L, translator, null, null, null, null, null);
|
||||
|
||||
Utils.BeginClassRegister(typeof(Tutorial.TestEnum), L, null, 3, 0, 0);
|
||||
|
||||
|
||||
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "E1", Tutorial.TestEnum.E1);
|
||||
|
||||
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "E2", Tutorial.TestEnum.E2);
|
||||
|
||||
|
||||
Utils.RegisterFunc(L, Utils.CLS_IDX, "__CastFrom", __CastFrom);
|
||||
|
||||
Utils.EndClassRegister(typeof(Tutorial.TestEnum), L, translator);
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int __CastFrom(RealStatePtr L)
|
||||
{
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
LuaTypes lua_type = LuaAPI.lua_type(L, 1);
|
||||
if (lua_type == LuaTypes.LUA_TNUMBER)
|
||||
{
|
||||
translator.PushTutorialTestEnum(L, (Tutorial.TestEnum)LuaAPI.xlua_tointeger(L, 1));
|
||||
}
|
||||
|
||||
else if(lua_type == LuaTypes.LUA_TSTRING)
|
||||
{
|
||||
|
||||
if (LuaAPI.xlua_is_eq_str(L, 1, "E1"))
|
||||
{
|
||||
translator.PushTutorialTestEnum(L, Tutorial.TestEnum.E1);
|
||||
}
|
||||
else if (LuaAPI.xlua_is_eq_str(L, 1, "E2"))
|
||||
{
|
||||
translator.PushTutorialTestEnum(L, Tutorial.TestEnum.E2);
|
||||
}
|
||||
else
|
||||
{
|
||||
return LuaAPI.luaL_error(L, "invalid string for Tutorial.TestEnum!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return LuaAPI.luaL_error(L, "invalid lua type for Tutorial.TestEnum! Expect number or string, got + " + lua_type);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
public class TutorialDerivedClassTestEnumInnerWrap
|
||||
{
|
||||
public static void __Register(RealStatePtr L)
|
||||
{
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
Utils.BeginObjectRegister(typeof(Tutorial.DerivedClass.TestEnumInner), L, translator, 0, 0, 0, 0);
|
||||
Utils.EndObjectRegister(typeof(Tutorial.DerivedClass.TestEnumInner), L, translator, null, null, null, null, null);
|
||||
|
||||
Utils.BeginClassRegister(typeof(Tutorial.DerivedClass.TestEnumInner), L, null, 3, 0, 0);
|
||||
|
||||
|
||||
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "E3", Tutorial.DerivedClass.TestEnumInner.E3);
|
||||
|
||||
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "E4", Tutorial.DerivedClass.TestEnumInner.E4);
|
||||
|
||||
|
||||
Utils.RegisterFunc(L, Utils.CLS_IDX, "__CastFrom", __CastFrom);
|
||||
|
||||
Utils.EndClassRegister(typeof(Tutorial.DerivedClass.TestEnumInner), L, translator);
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int __CastFrom(RealStatePtr L)
|
||||
{
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
LuaTypes lua_type = LuaAPI.lua_type(L, 1);
|
||||
if (lua_type == LuaTypes.LUA_TNUMBER)
|
||||
{
|
||||
translator.PushTutorialDerivedClassTestEnumInner(L, (Tutorial.DerivedClass.TestEnumInner)LuaAPI.xlua_tointeger(L, 1));
|
||||
}
|
||||
|
||||
else if(lua_type == LuaTypes.LUA_TSTRING)
|
||||
{
|
||||
|
||||
if (LuaAPI.xlua_is_eq_str(L, 1, "E3"))
|
||||
{
|
||||
translator.PushTutorialDerivedClassTestEnumInner(L, Tutorial.DerivedClass.TestEnumInner.E3);
|
||||
}
|
||||
else if (LuaAPI.xlua_is_eq_str(L, 1, "E4"))
|
||||
{
|
||||
translator.PushTutorialDerivedClassTestEnumInner(L, Tutorial.DerivedClass.TestEnumInner.E4);
|
||||
}
|
||||
else
|
||||
{
|
||||
return LuaAPI.luaL_error(L, "invalid string for Tutorial.DerivedClass.TestEnumInner!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return LuaAPI.luaL_error(L, "invalid lua type for Tutorial.DerivedClass.TestEnumInner! Expect number or string, got + " + lua_type);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8645f88f845f8e24184a8544ab074946
|
||||
guid: 95a8849a57110d147bc3c33fce585288
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6f3cc4ce63cbe394490e0f157c48eed1
|
||||
guid: 317c5de54f637094085a67d30e5d255a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6964e9a023ed6d947baa485a4245d196
|
||||
guid: 39abc772b569a2c4f98802f46c7be18a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 26677933e03919549bda0c1f6af15a51
|
||||
guid: ff34893e33fddfa44896f7b43352a889
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 94029633e2eaf2f4588d17299699293e
|
||||
guid: 08f5d03da89f4544ebfcb3876b70d725
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -21,7 +21,7 @@ namespace XLua.CSObjectWrap
|
||||
{
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
System.Type type = typeof(SdkControl);
|
||||
Utils.BeginObjectRegister(type, L, translator, 0, 20, 3, 0);
|
||||
Utils.BeginObjectRegister(type, L, translator, 0, 21, 3, 0);
|
||||
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetDefaultServer", _m_GetDefaultServer);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsSdkLogin", _m_IsSdkLogin);
|
||||
@ -35,6 +35,7 @@ namespace XLua.CSObjectWrap
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoginPhp", _m_LoginPhp);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetServerList", _m_GetServerList);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "PostServerList", _m_PostServerList);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SubmitLoadData", _m_SubmitLoadData);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SubmitData", _m_SubmitData);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoginSdk", _m_LoginSdk);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "CloseGame", _m_CloseGame);
|
||||
@ -422,6 +423,34 @@ namespace XLua.CSObjectWrap
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_SubmitLoadData(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
SdkControl gen_to_be_invoked = (SdkControl)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
LoadDataType _action;translator.Get(L, 2, out _action);
|
||||
|
||||
gen_to_be_invoked.SubmitLoadData( _action );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d7ee3e045874eb44ab5a110c06c72f06
|
||||
guid: e9433347543c52242a7ebc4481f4235a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd315d4e958f61b4ead2744944d1a3f7
|
||||
guid: 95f86593f83421a4888ede838e47d922
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e1ac3206a2b9a0945aec71ae5f3f9c2a
|
||||
guid: 5fe6fa7887c50fe46809f61d34f05c32
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 623d5e2c7ee88fa439cdfe38062ebcb8
|
||||
guid: 329cc76ac4de33a48ae84bf6cf71f102
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89ed18de2e3af9142b89268659bc4402
|
||||
guid: a61a66046bfa4ea48ab38dabd8de7d3d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1e8803db0f7b3404b81116a0d6301803
|
||||
guid: c7a7f71d2ff007f4bbd96a35de063195
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6f5ea83deef35174ebd17f1c98143d1c
|
||||
guid: aa9253fb586771b40ace1d97a20eba1a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
223
Assets/XLua/Gen/Tutorial_BaseClassWrap.cs
Normal file
223
Assets/XLua/Gen/Tutorial_BaseClassWrap.cs
Normal file
@ -0,0 +1,223 @@
|
||||
#if USE_UNI_LUA
|
||||
using LuaAPI = UniLua.Lua;
|
||||
using RealStatePtr = UniLua.ILuaState;
|
||||
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
|
||||
#else
|
||||
using LuaAPI = XLua.LuaDLL.Lua;
|
||||
using RealStatePtr = System.IntPtr;
|
||||
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
|
||||
#endif
|
||||
|
||||
using XLua;
|
||||
using System.Collections.Generic;
|
||||
using Tutorial;
|
||||
|
||||
namespace XLua.CSObjectWrap
|
||||
{
|
||||
using Utils = XLua.Utils;
|
||||
public class TutorialBaseClassWrap
|
||||
{
|
||||
public static void __Register(RealStatePtr L)
|
||||
{
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
System.Type type = typeof(Tutorial.BaseClass);
|
||||
Utils.BeginObjectRegister(type, L, translator, 0, 2, 1, 1);
|
||||
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "BMFunc", _m_BMFunc);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetSomeBaseData", _m_GetSomeBaseData);
|
||||
|
||||
|
||||
Utils.RegisterFunc(L, Utils.GETTER_IDX, "BMF", _g_get_BMF);
|
||||
|
||||
Utils.RegisterFunc(L, Utils.SETTER_IDX, "BMF", _s_set_BMF);
|
||||
|
||||
|
||||
Utils.EndObjectRegister(type, L, translator, null, null,
|
||||
null, null, null);
|
||||
|
||||
Utils.BeginClassRegister(type, L, __CreateInstance, 2, 1, 1);
|
||||
Utils.RegisterFunc(L, Utils.CLS_IDX, "BSFunc", _m_BSFunc_xlua_st_);
|
||||
|
||||
|
||||
|
||||
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "BSF", _g_get_BSF);
|
||||
|
||||
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "BSF", _s_set_BSF);
|
||||
|
||||
|
||||
Utils.EndClassRegister(type, L, translator);
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int __CreateInstance(RealStatePtr L)
|
||||
{
|
||||
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
if(LuaAPI.lua_gettop(L) == 1)
|
||||
{
|
||||
|
||||
var gen_ret = new Tutorial.BaseClass();
|
||||
translator.Push(L, gen_ret);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return LuaAPI.luaL_error(L, "invalid arguments to Tutorial.BaseClass constructor!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_BSFunc_xlua_st_(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
||||
Tutorial.BaseClass.BSFunc( );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_BMFunc(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
Tutorial.BaseClass gen_to_be_invoked = (Tutorial.BaseClass)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
||||
gen_to_be_invoked.BMFunc( );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_GetSomeBaseData(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
Tutorial.BaseClass gen_to_be_invoked = (Tutorial.BaseClass)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
||||
var gen_ret = gen_to_be_invoked.GetSomeBaseData( );
|
||||
LuaAPI.xlua_pushinteger(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _g_get_BMF(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
Tutorial.BaseClass gen_to_be_invoked = (Tutorial.BaseClass)translator.FastGetCSObj(L, 1);
|
||||
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.BMF);
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _g_get_BSF(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
LuaAPI.xlua_pushinteger(L, Tutorial.BaseClass.BSF);
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _s_set_BMF(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
Tutorial.BaseClass gen_to_be_invoked = (Tutorial.BaseClass)translator.FastGetCSObj(L, 1);
|
||||
gen_to_be_invoked.BMF = LuaAPI.xlua_tointeger(L, 2);
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _s_set_BSF(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
Tutorial.BaseClass.BSF = LuaAPI.xlua_tointeger(L, 1);
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
11
Assets/XLua/Gen/Tutorial_BaseClassWrap.cs.meta
Normal file
11
Assets/XLua/Gen/Tutorial_BaseClassWrap.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7710be590eeffd24a822a0bd92741d0d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
177
Assets/XLua/Gen/Tutorial_CSCallLua_ItfDBridge.cs
Normal file
177
Assets/XLua/Gen/Tutorial_CSCallLua_ItfDBridge.cs
Normal file
@ -0,0 +1,177 @@
|
||||
#if USE_UNI_LUA
|
||||
using LuaAPI = UniLua.Lua;
|
||||
using RealStatePtr = UniLua.ILuaState;
|
||||
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
|
||||
#else
|
||||
using LuaAPI = XLua.LuaDLL.Lua;
|
||||
using RealStatePtr = System.IntPtr;
|
||||
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
|
||||
#endif
|
||||
|
||||
using XLua;
|
||||
using System;
|
||||
|
||||
|
||||
namespace XLua.CSObjectWrap
|
||||
{
|
||||
public class TutorialCSCallLuaItfDBridge : LuaBase, Tutorial.CSCallLua.ItfD
|
||||
{
|
||||
public static LuaBase __Create(int reference, LuaEnv luaenv)
|
||||
{
|
||||
return new TutorialCSCallLuaItfDBridge(reference, luaenv);
|
||||
}
|
||||
|
||||
public TutorialCSCallLuaItfDBridge(int reference, LuaEnv luaenv) : base(reference, luaenv)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
int Tutorial.CSCallLua.ItfD.add(int a, int b)
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
{
|
||||
#endif
|
||||
RealStatePtr L = luaEnv.L;
|
||||
int err_func = LuaAPI.load_error_func(L, luaEnv.errorFuncRef);
|
||||
|
||||
|
||||
LuaAPI.lua_getref(L, luaReference);
|
||||
LuaAPI.xlua_pushasciistring(L, "add");
|
||||
if (0 != LuaAPI.xlua_pgettable(L, -2))
|
||||
{
|
||||
luaEnv.ThrowExceptionFromError(err_func - 1);
|
||||
}
|
||||
if(!LuaAPI.lua_isfunction(L, -1))
|
||||
{
|
||||
LuaAPI.xlua_pushasciistring(L, "no such function add");
|
||||
luaEnv.ThrowExceptionFromError(err_func - 1);
|
||||
}
|
||||
LuaAPI.lua_pushvalue(L, -2);
|
||||
LuaAPI.lua_remove(L, -3);
|
||||
LuaAPI.xlua_pushinteger(L, a);
|
||||
LuaAPI.xlua_pushinteger(L, b);
|
||||
|
||||
int __gen_error = LuaAPI.lua_pcall(L, 3, 1, err_func);
|
||||
if (__gen_error != 0)
|
||||
luaEnv.ThrowExceptionFromError(err_func - 1);
|
||||
|
||||
|
||||
int __gen_ret = LuaAPI.xlua_tointeger(L, err_func + 1);
|
||||
LuaAPI.lua_settop(L, err_func - 1);
|
||||
return __gen_ret;
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
int Tutorial.CSCallLua.ItfD.f1
|
||||
{
|
||||
|
||||
get
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
{
|
||||
#endif
|
||||
RealStatePtr L = luaEnv.L;
|
||||
int oldTop = LuaAPI.lua_gettop(L);
|
||||
|
||||
LuaAPI.lua_getref(L, luaReference);
|
||||
LuaAPI.xlua_pushasciistring(L, "f1");
|
||||
if (0 != LuaAPI.xlua_pgettable(L, -2))
|
||||
{
|
||||
luaEnv.ThrowExceptionFromError(oldTop);
|
||||
}
|
||||
int __gen_ret = LuaAPI.xlua_tointeger(L, -1);
|
||||
LuaAPI.lua_pop(L, 2);
|
||||
return __gen_ret;
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
set
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
{
|
||||
#endif
|
||||
RealStatePtr L = luaEnv.L;
|
||||
int oldTop = LuaAPI.lua_gettop(L);
|
||||
|
||||
LuaAPI.lua_getref(L, luaReference);
|
||||
LuaAPI.xlua_pushasciistring(L, "f1");
|
||||
LuaAPI.xlua_pushinteger(L, value);
|
||||
if (0 != LuaAPI.xlua_psettable(L, -3))
|
||||
{
|
||||
luaEnv.ThrowExceptionFromError(oldTop);
|
||||
}
|
||||
LuaAPI.lua_pop(L, 1);
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int Tutorial.CSCallLua.ItfD.f2
|
||||
{
|
||||
|
||||
get
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
{
|
||||
#endif
|
||||
RealStatePtr L = luaEnv.L;
|
||||
int oldTop = LuaAPI.lua_gettop(L);
|
||||
|
||||
LuaAPI.lua_getref(L, luaReference);
|
||||
LuaAPI.xlua_pushasciistring(L, "f2");
|
||||
if (0 != LuaAPI.xlua_pgettable(L, -2))
|
||||
{
|
||||
luaEnv.ThrowExceptionFromError(oldTop);
|
||||
}
|
||||
int __gen_ret = LuaAPI.xlua_tointeger(L, -1);
|
||||
LuaAPI.lua_pop(L, 2);
|
||||
return __gen_ret;
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
set
|
||||
{
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
lock (luaEnv.luaEnvLock)
|
||||
{
|
||||
#endif
|
||||
RealStatePtr L = luaEnv.L;
|
||||
int oldTop = LuaAPI.lua_gettop(L);
|
||||
|
||||
LuaAPI.lua_getref(L, luaReference);
|
||||
LuaAPI.xlua_pushasciistring(L, "f2");
|
||||
LuaAPI.xlua_pushinteger(L, value);
|
||||
if (0 != LuaAPI.xlua_psettable(L, -3))
|
||||
{
|
||||
luaEnv.ThrowExceptionFromError(oldTop);
|
||||
}
|
||||
LuaAPI.lua_pop(L, 1);
|
||||
#if THREAD_SAFE || HOTFIX_ENABLE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
11
Assets/XLua/Gen/Tutorial_CSCallLua_ItfDBridge.cs.meta
Normal file
11
Assets/XLua/Gen/Tutorial_CSCallLua_ItfDBridge.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 67cff5a973c7c8c4a9f12424c401a2dc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
67
Assets/XLua/Gen/Tutorial_DerivedClassExtensionsWrap.cs
Normal file
67
Assets/XLua/Gen/Tutorial_DerivedClassExtensionsWrap.cs
Normal file
@ -0,0 +1,67 @@
|
||||
#if USE_UNI_LUA
|
||||
using LuaAPI = UniLua.Lua;
|
||||
using RealStatePtr = UniLua.ILuaState;
|
||||
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
|
||||
#else
|
||||
using LuaAPI = XLua.LuaDLL.Lua;
|
||||
using RealStatePtr = System.IntPtr;
|
||||
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
|
||||
#endif
|
||||
|
||||
using XLua;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace XLua.CSObjectWrap
|
||||
{
|
||||
using Utils = XLua.Utils;
|
||||
public class TutorialDerivedClassExtensionsWrap
|
||||
{
|
||||
public static void __Register(RealStatePtr L)
|
||||
{
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
System.Type type = typeof(Tutorial.DerivedClassExtensions);
|
||||
Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Utils.EndObjectRegister(type, L, translator, null, null,
|
||||
null, null, null);
|
||||
|
||||
Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Utils.EndClassRegister(type, L, translator);
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int __CreateInstance(RealStatePtr L)
|
||||
{
|
||||
return LuaAPI.luaL_error(L, "Tutorial.DerivedClassExtensions does not have a constructor!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
11
Assets/XLua/Gen/Tutorial_DerivedClassExtensionsWrap.cs.meta
Normal file
11
Assets/XLua/Gen/Tutorial_DerivedClassExtensionsWrap.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8800a3a951483c94aaa590b9a300d21d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
588
Assets/XLua/Gen/Tutorial_DerivedClassWrap.cs
Normal file
588
Assets/XLua/Gen/Tutorial_DerivedClassWrap.cs
Normal file
@ -0,0 +1,588 @@
|
||||
#if USE_UNI_LUA
|
||||
using LuaAPI = UniLua.Lua;
|
||||
using RealStatePtr = UniLua.ILuaState;
|
||||
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
|
||||
#else
|
||||
using LuaAPI = XLua.LuaDLL.Lua;
|
||||
using RealStatePtr = System.IntPtr;
|
||||
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
|
||||
#endif
|
||||
|
||||
using XLua;
|
||||
using System.Collections.Generic;
|
||||
using Tutorial;
|
||||
|
||||
namespace XLua.CSObjectWrap
|
||||
{
|
||||
using Utils = XLua.Utils;
|
||||
public class TutorialDerivedClassWrap
|
||||
{
|
||||
public static void __Register(RealStatePtr L)
|
||||
{
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
System.Type type = typeof(Tutorial.DerivedClass);
|
||||
Utils.BeginObjectRegister(type, L, translator, 1, 12, 2, 2);
|
||||
Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__add", __AddMeta);
|
||||
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "DMFunc", _m_DMFunc);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "ComplexFunc", _m_ComplexFunc);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "TestFunc", _m_TestFunc);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "DefaultValueFunc", _m_DefaultValueFunc);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "VariableParamsFunc", _m_VariableParamsFunc);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "EnumTestFunc", _m_EnumTestFunc);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "CallEvent", _m_CallEvent);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "TestLong", _m_TestLong);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetCalc", _m_GetCalc);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetSomeData", _m_GetSomeData);
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GenericMethodOfString", _m_GenericMethodOfString);
|
||||
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "TestEvent", _e_TestEvent);
|
||||
|
||||
Utils.RegisterFunc(L, Utils.GETTER_IDX, "DMF", _g_get_DMF);
|
||||
Utils.RegisterFunc(L, Utils.GETTER_IDX, "TestDelegate", _g_get_TestDelegate);
|
||||
|
||||
Utils.RegisterFunc(L, Utils.SETTER_IDX, "DMF", _s_set_DMF);
|
||||
Utils.RegisterFunc(L, Utils.SETTER_IDX, "TestDelegate", _s_set_TestDelegate);
|
||||
|
||||
|
||||
Utils.EndObjectRegister(type, L, translator, null, null,
|
||||
null, null, null);
|
||||
|
||||
Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Utils.EndClassRegister(type, L, translator);
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int __CreateInstance(RealStatePtr L)
|
||||
{
|
||||
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
if(LuaAPI.lua_gettop(L) == 1)
|
||||
{
|
||||
|
||||
var gen_ret = new Tutorial.DerivedClass();
|
||||
translator.Push(L, gen_ret);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return LuaAPI.luaL_error(L, "invalid arguments to Tutorial.DerivedClass constructor!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int __AddMeta(RealStatePtr L)
|
||||
{
|
||||
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
if (translator.Assignable<Tutorial.DerivedClass>(L, 1) && translator.Assignable<Tutorial.DerivedClass>(L, 2))
|
||||
{
|
||||
Tutorial.DerivedClass leftside = (Tutorial.DerivedClass)translator.GetObject(L, 1, typeof(Tutorial.DerivedClass));
|
||||
Tutorial.DerivedClass rightside = (Tutorial.DerivedClass)translator.GetObject(L, 2, typeof(Tutorial.DerivedClass));
|
||||
|
||||
translator.Push(L, leftside + rightside);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return LuaAPI.luaL_error(L, "invalid arguments to right hand of + operator, need Tutorial.DerivedClass!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_DMFunc(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
||||
gen_to_be_invoked.DMFunc( );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_ComplexFunc(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
Tutorial.Param1 _p1;translator.Get(L, 2, out _p1);
|
||||
int _p2 = LuaAPI.xlua_tointeger(L, 3);
|
||||
string _p3;
|
||||
System.Action _luafunc = translator.GetDelegate<System.Action>(L, 4);
|
||||
System.Action _csfunc;
|
||||
|
||||
var gen_ret = gen_to_be_invoked.ComplexFunc( _p1, ref _p2, out _p3, _luafunc, out _csfunc );
|
||||
LuaAPI.lua_pushnumber(L, gen_ret);
|
||||
LuaAPI.xlua_pushinteger(L, _p2);
|
||||
|
||||
LuaAPI.lua_pushstring(L, _p3);
|
||||
|
||||
translator.Push(L, _csfunc);
|
||||
|
||||
|
||||
|
||||
|
||||
return 4;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_TestFunc(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
int gen_param_count = LuaAPI.lua_gettop(L);
|
||||
|
||||
if(gen_param_count == 2&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
|
||||
{
|
||||
int _i = LuaAPI.xlua_tointeger(L, 2);
|
||||
|
||||
gen_to_be_invoked.TestFunc( _i );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
|
||||
{
|
||||
string _i = LuaAPI.lua_tostring(L, 2);
|
||||
|
||||
gen_to_be_invoked.TestFunc( _i );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
return LuaAPI.luaL_error(L, "invalid arguments to Tutorial.DerivedClass.TestFunc!");
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_DefaultValueFunc(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
int gen_param_count = LuaAPI.lua_gettop(L);
|
||||
|
||||
if(gen_param_count == 4&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 4) || LuaAPI.lua_type(L, 4) == LuaTypes.LUA_TSTRING))
|
||||
{
|
||||
int _a = LuaAPI.xlua_tointeger(L, 2);
|
||||
string _b = LuaAPI.lua_tostring(L, 3);
|
||||
string _c = LuaAPI.lua_tostring(L, 4);
|
||||
|
||||
gen_to_be_invoked.DefaultValueFunc( _a, _b, _c );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
if(gen_param_count == 3&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
|
||||
{
|
||||
int _a = LuaAPI.xlua_tointeger(L, 2);
|
||||
string _b = LuaAPI.lua_tostring(L, 3);
|
||||
|
||||
gen_to_be_invoked.DefaultValueFunc( _a, _b );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
if(gen_param_count == 2&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
|
||||
{
|
||||
int _a = LuaAPI.xlua_tointeger(L, 2);
|
||||
|
||||
gen_to_be_invoked.DefaultValueFunc( _a );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
if(gen_param_count == 1)
|
||||
{
|
||||
|
||||
gen_to_be_invoked.DefaultValueFunc( );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
return LuaAPI.luaL_error(L, "invalid arguments to Tutorial.DerivedClass.DefaultValueFunc!");
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_VariableParamsFunc(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
int _a = LuaAPI.xlua_tointeger(L, 2);
|
||||
string[] _strs = translator.GetParams<string>(L, 3);
|
||||
|
||||
gen_to_be_invoked.VariableParamsFunc( _a, _strs );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_EnumTestFunc(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
Tutorial.TestEnum _e;translator.Get(L, 2, out _e);
|
||||
|
||||
var gen_ret = gen_to_be_invoked.EnumTestFunc( _e );
|
||||
translator.PushTutorialTestEnum(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_CallEvent(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
||||
gen_to_be_invoked.CallEvent( );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_TestLong(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
long _n = LuaAPI.lua_toint64(L, 2);
|
||||
|
||||
var gen_ret = gen_to_be_invoked.TestLong( _n );
|
||||
LuaAPI.lua_pushuint64(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_GetCalc(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
||||
var gen_ret = gen_to_be_invoked.GetCalc( );
|
||||
translator.PushAny(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_GetSomeData(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
||||
var gen_ret = gen_to_be_invoked.GetSomeData( );
|
||||
LuaAPI.xlua_pushinteger(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_GenericMethodOfString(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
||||
gen_to_be_invoked.GenericMethodOfString( );
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _g_get_DMF(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.DMF);
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _g_get_TestDelegate(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
translator.Push(L, gen_to_be_invoked.TestDelegate);
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _s_set_DMF(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
gen_to_be_invoked.DMF = LuaAPI.xlua_tointeger(L, 2);
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _s_set_TestDelegate(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
gen_to_be_invoked.TestDelegate = translator.GetDelegate<System.Action<string>>(L, 2);
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _e_TestEvent(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
int gen_param_count = LuaAPI.lua_gettop(L);
|
||||
Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1);
|
||||
System.Action gen_delegate = translator.GetDelegate<System.Action>(L, 3);
|
||||
if (gen_delegate == null) {
|
||||
return LuaAPI.luaL_error(L, "#3 need System.Action!");
|
||||
}
|
||||
|
||||
if (gen_param_count == 3)
|
||||
{
|
||||
|
||||
if (LuaAPI.xlua_is_eq_str(L, 2, "+")) {
|
||||
gen_to_be_invoked.TestEvent += gen_delegate;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
|
||||
gen_to_be_invoked.TestEvent -= gen_delegate;
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
LuaAPI.luaL_error(L, "invalid arguments to Tutorial.DerivedClass.TestEvent!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
11
Assets/XLua/Gen/Tutorial_DerivedClassWrap.cs.meta
Normal file
11
Assets/XLua/Gen/Tutorial_DerivedClassWrap.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ba1758fa203c5641ba023884fb9e400
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
98
Assets/XLua/Gen/Tutorial_ICalcWrap.cs
Normal file
98
Assets/XLua/Gen/Tutorial_ICalcWrap.cs
Normal file
@ -0,0 +1,98 @@
|
||||
#if USE_UNI_LUA
|
||||
using LuaAPI = UniLua.Lua;
|
||||
using RealStatePtr = UniLua.ILuaState;
|
||||
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
|
||||
#else
|
||||
using LuaAPI = XLua.LuaDLL.Lua;
|
||||
using RealStatePtr = System.IntPtr;
|
||||
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
|
||||
#endif
|
||||
|
||||
using XLua;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace XLua.CSObjectWrap
|
||||
{
|
||||
using Utils = XLua.Utils;
|
||||
public class TutorialICalcWrap
|
||||
{
|
||||
public static void __Register(RealStatePtr L)
|
||||
{
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
System.Type type = typeof(Tutorial.ICalc);
|
||||
Utils.BeginObjectRegister(type, L, translator, 0, 1, 0, 0);
|
||||
|
||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "add", _m_add);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Utils.EndObjectRegister(type, L, translator, null, null,
|
||||
null, null, null);
|
||||
|
||||
Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Utils.EndClassRegister(type, L, translator);
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int __CreateInstance(RealStatePtr L)
|
||||
{
|
||||
return LuaAPI.luaL_error(L, "Tutorial.ICalc does not have a constructor!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int _m_add(RealStatePtr L)
|
||||
{
|
||||
try {
|
||||
|
||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||
|
||||
|
||||
Tutorial.ICalc gen_to_be_invoked = (Tutorial.ICalc)translator.FastGetCSObj(L, 1);
|
||||
|
||||
|
||||
|
||||
{
|
||||
int _a = LuaAPI.xlua_tointeger(L, 2);
|
||||
int _b = LuaAPI.xlua_tointeger(L, 3);
|
||||
|
||||
var gen_ret = gen_to_be_invoked.add( _a, _b );
|
||||
LuaAPI.xlua_pushinteger(L, gen_ret);
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
} catch(System.Exception gen_e) {
|
||||
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
11
Assets/XLua/Gen/Tutorial_ICalcWrap.cs.meta
Normal file
11
Assets/XLua/Gen/Tutorial_ICalcWrap.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25cdb7840aba565438e7895290647faa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bb5f9a2ae7c8054a9f25a8a57750957
|
||||
guid: 68371e894dc4e3443b4160a233a99b8f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b333347953071d54d860eef6a0ca1c7a
|
||||
guid: 40a9eaa3e666427409aad39c7a3ed8ae
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a0232246804b21246a6b608f205af252
|
||||
guid: c8a19cb8fceaf1c469bd36870db507bf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: adb503b772bc60d46ab1453dbf036115
|
||||
guid: 11920ececb4991941a4e0153b482c573
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 160a1c6cfaf54c44d8254eb460a4f04b
|
||||
guid: 6599f08f0db163b4d8a61f17c391e3d0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 11d60c01a727eb847aa8c21168c786a3
|
||||
guid: 1afb1439e494d2c49abee537d7227e36
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1dfde75c1191db0468fd9c26cac56a84
|
||||
guid: 611b5394c8538724b9dd3160b01e1664
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a1661c1df9dbadb44b90a8fb5430736d
|
||||
guid: 900d37d56e40dec4a81e1665a027a0f4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 824677f4375417546b2de0acd0a730a2
|
||||
guid: bf7550cfc6233ef4f931d018ca5e1e01
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39980aca30048db4a914d54871813977
|
||||
guid: 919b0f7c797c14c40aa60fd799d0adf9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f63bf30521e432c44a6bad89540c6f4e
|
||||
guid: d7a53b2353f2e6e4e9b3cddf79be7784
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e9edcfeb80fe1044a981fe1ed0e5e4a3
|
||||
guid: 530bdfed8c846a24ba2cdde2a2e75b74
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 04013f6f4fb24014d94fec367bb1e03f
|
||||
guid: fcb00702fc6f6754ca9a894e18ef2223
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bd44fdc562bac44db31e3e05fea9053
|
||||
guid: bdabe9321097c424cac47612f60e5f20
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd301e47f80fa534c9678690b6cd0845
|
||||
guid: e58f2c232ba578549bc41c923a1a5dca
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 636b040c3a8558340bff8acdd677e548
|
||||
guid: fe1afab448b11b346abcd544102edc50
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07b293b2159210f4ba36c280e4df1cfc
|
||||
guid: 6c4214c0cd38bd441a35a5754ba5f8a6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 11f99f92166187048890ab063af826cc
|
||||
guid: b9674ab747d3bd049b2d0c479a4627b5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c4aefb997e09adb4db3214ec2038c0f7
|
||||
guid: b4d8e31a911ab23408352eec7437d425
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 42db8ea32f53e704ab17813c2b434aa6
|
||||
guid: c6cccc12700efe84b92ed42500ba5522
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bcaa7c6d3a38b8448bfa0b52259b4b05
|
||||
guid: fde8bce6c5d195740b3592ff3a41678e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 254b27362b3a00142bbb4b7f9ee34608
|
||||
guid: 3aa631cce4a7e04419886cdb6d29bcf0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 73a939ac4eb7a204eafddf57040c28c7
|
||||
guid: 9c4085e16499eaa41b51d2a408df3d05
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f9299a50afeb87b4584bc2e01577cd29
|
||||
guid: b90762747f37a21408ca6c3b35d84bb4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3f831fc4cf8ac714ea63d2a93c7a78de
|
||||
guid: 8ff91b362932b9a49a4c15a36933d9b0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a8948a122de911749922d3a9c1fd4093
|
||||
guid: ba06410f2c4cfe34ab1a7af423180de1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 97f1ef9d5f5182b4ea1368f3cc7f0c0e
|
||||
guid: 89173378345d35f468b6a3866a64ffce
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -34,6 +34,8 @@ namespace XLua
|
||||
translator.RegisterPushAndGetAndUpdate<UnityEngine.Ray>(translator.PushUnityEngineRay, translator.Get, translator.UpdateUnityEngineRay);
|
||||
translator.RegisterPushAndGetAndUpdate<UnityEngine.Bounds>(translator.PushUnityEngineBounds, translator.Get, translator.UpdateUnityEngineBounds);
|
||||
translator.RegisterPushAndGetAndUpdate<UnityEngine.Ray2D>(translator.PushUnityEngineRay2D, translator.Get, translator.UpdateUnityEngineRay2D);
|
||||
translator.RegisterPushAndGetAndUpdate<Tutorial.TestEnum>(translator.PushTutorialTestEnum, translator.Get, translator.UpdateTutorialTestEnum);
|
||||
translator.RegisterPushAndGetAndUpdate<Tutorial.DerivedClass.TestEnumInner>(translator.PushTutorialDerivedClassTestEnumInner, translator.Get, translator.UpdateTutorialDerivedClassTestEnumInner);
|
||||
|
||||
}
|
||||
}
|
||||
@ -570,6 +572,174 @@ namespace XLua
|
||||
}
|
||||
}
|
||||
|
||||
int TutorialTestEnum_TypeID = -1;
|
||||
int TutorialTestEnum_EnumRef = -1;
|
||||
|
||||
public void PushTutorialTestEnum(RealStatePtr L, Tutorial.TestEnum val)
|
||||
{
|
||||
if (TutorialTestEnum_TypeID == -1)
|
||||
{
|
||||
bool is_first;
|
||||
TutorialTestEnum_TypeID = getTypeId(L, typeof(Tutorial.TestEnum), out is_first);
|
||||
|
||||
if (TutorialTestEnum_EnumRef == -1)
|
||||
{
|
||||
Utils.LoadCSTable(L, typeof(Tutorial.TestEnum));
|
||||
TutorialTestEnum_EnumRef = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (LuaAPI.xlua_tryget_cachedud(L, (int)val, TutorialTestEnum_EnumRef) == 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IntPtr buff = LuaAPI.xlua_pushstruct(L, 4, TutorialTestEnum_TypeID);
|
||||
if (!CopyByValue.Pack(buff, 0, (int)val))
|
||||
{
|
||||
throw new Exception("pack fail fail for Tutorial.TestEnum ,value="+val);
|
||||
}
|
||||
|
||||
LuaAPI.lua_getref(L, TutorialTestEnum_EnumRef);
|
||||
LuaAPI.lua_pushvalue(L, -2);
|
||||
LuaAPI.xlua_rawseti(L, -2, (int)val);
|
||||
LuaAPI.lua_pop(L, 1);
|
||||
|
||||
}
|
||||
|
||||
public void Get(RealStatePtr L, int index, out Tutorial.TestEnum val)
|
||||
{
|
||||
LuaTypes type = LuaAPI.lua_type(L, index);
|
||||
if (type == LuaTypes.LUA_TUSERDATA )
|
||||
{
|
||||
if (LuaAPI.xlua_gettypeid(L, index) != TutorialTestEnum_TypeID)
|
||||
{
|
||||
throw new Exception("invalid userdata for Tutorial.TestEnum");
|
||||
}
|
||||
|
||||
IntPtr buff = LuaAPI.lua_touserdata(L, index);
|
||||
int e;
|
||||
if (!CopyByValue.UnPack(buff, 0, out e))
|
||||
{
|
||||
throw new Exception("unpack fail for Tutorial.TestEnum");
|
||||
}
|
||||
val = (Tutorial.TestEnum)e;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
val = (Tutorial.TestEnum)objectCasters.GetCaster(typeof(Tutorial.TestEnum))(L, index, null);
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateTutorialTestEnum(RealStatePtr L, int index, Tutorial.TestEnum val)
|
||||
{
|
||||
|
||||
if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
|
||||
{
|
||||
if (LuaAPI.xlua_gettypeid(L, index) != TutorialTestEnum_TypeID)
|
||||
{
|
||||
throw new Exception("invalid userdata for Tutorial.TestEnum");
|
||||
}
|
||||
|
||||
IntPtr buff = LuaAPI.lua_touserdata(L, index);
|
||||
if (!CopyByValue.Pack(buff, 0, (int)val))
|
||||
{
|
||||
throw new Exception("pack fail for Tutorial.TestEnum ,value="+val);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
|
||||
}
|
||||
}
|
||||
|
||||
int TutorialDerivedClassTestEnumInner_TypeID = -1;
|
||||
int TutorialDerivedClassTestEnumInner_EnumRef = -1;
|
||||
|
||||
public void PushTutorialDerivedClassTestEnumInner(RealStatePtr L, Tutorial.DerivedClass.TestEnumInner val)
|
||||
{
|
||||
if (TutorialDerivedClassTestEnumInner_TypeID == -1)
|
||||
{
|
||||
bool is_first;
|
||||
TutorialDerivedClassTestEnumInner_TypeID = getTypeId(L, typeof(Tutorial.DerivedClass.TestEnumInner), out is_first);
|
||||
|
||||
if (TutorialDerivedClassTestEnumInner_EnumRef == -1)
|
||||
{
|
||||
Utils.LoadCSTable(L, typeof(Tutorial.DerivedClass.TestEnumInner));
|
||||
TutorialDerivedClassTestEnumInner_EnumRef = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (LuaAPI.xlua_tryget_cachedud(L, (int)val, TutorialDerivedClassTestEnumInner_EnumRef) == 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IntPtr buff = LuaAPI.xlua_pushstruct(L, 4, TutorialDerivedClassTestEnumInner_TypeID);
|
||||
if (!CopyByValue.Pack(buff, 0, (int)val))
|
||||
{
|
||||
throw new Exception("pack fail fail for Tutorial.DerivedClass.TestEnumInner ,value="+val);
|
||||
}
|
||||
|
||||
LuaAPI.lua_getref(L, TutorialDerivedClassTestEnumInner_EnumRef);
|
||||
LuaAPI.lua_pushvalue(L, -2);
|
||||
LuaAPI.xlua_rawseti(L, -2, (int)val);
|
||||
LuaAPI.lua_pop(L, 1);
|
||||
|
||||
}
|
||||
|
||||
public void Get(RealStatePtr L, int index, out Tutorial.DerivedClass.TestEnumInner val)
|
||||
{
|
||||
LuaTypes type = LuaAPI.lua_type(L, index);
|
||||
if (type == LuaTypes.LUA_TUSERDATA )
|
||||
{
|
||||
if (LuaAPI.xlua_gettypeid(L, index) != TutorialDerivedClassTestEnumInner_TypeID)
|
||||
{
|
||||
throw new Exception("invalid userdata for Tutorial.DerivedClass.TestEnumInner");
|
||||
}
|
||||
|
||||
IntPtr buff = LuaAPI.lua_touserdata(L, index);
|
||||
int e;
|
||||
if (!CopyByValue.UnPack(buff, 0, out e))
|
||||
{
|
||||
throw new Exception("unpack fail for Tutorial.DerivedClass.TestEnumInner");
|
||||
}
|
||||
val = (Tutorial.DerivedClass.TestEnumInner)e;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
val = (Tutorial.DerivedClass.TestEnumInner)objectCasters.GetCaster(typeof(Tutorial.DerivedClass.TestEnumInner))(L, index, null);
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateTutorialDerivedClassTestEnumInner(RealStatePtr L, int index, Tutorial.DerivedClass.TestEnumInner val)
|
||||
{
|
||||
|
||||
if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
|
||||
{
|
||||
if (LuaAPI.xlua_gettypeid(L, index) != TutorialDerivedClassTestEnumInner_TypeID)
|
||||
{
|
||||
throw new Exception("invalid userdata for Tutorial.DerivedClass.TestEnumInner");
|
||||
}
|
||||
|
||||
IntPtr buff = LuaAPI.lua_touserdata(L, index);
|
||||
if (!CopyByValue.Pack(buff, 0, (int)val))
|
||||
{
|
||||
throw new Exception("pack fail for Tutorial.DerivedClass.TestEnumInner ,value="+val);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// table cast optimze
|
||||
|
||||
@ -629,6 +799,18 @@ namespace XLua
|
||||
translator.PushUnityEngineRay2D(L, array[index]);
|
||||
return true;
|
||||
}
|
||||
else if (type == typeof(Tutorial.TestEnum[]))
|
||||
{
|
||||
Tutorial.TestEnum[] array = obj as Tutorial.TestEnum[];
|
||||
translator.PushTutorialTestEnum(L, array[index]);
|
||||
return true;
|
||||
}
|
||||
else if (type == typeof(Tutorial.DerivedClass.TestEnumInner[]))
|
||||
{
|
||||
Tutorial.DerivedClass.TestEnumInner[] array = obj as Tutorial.DerivedClass.TestEnumInner[];
|
||||
translator.PushTutorialDerivedClassTestEnumInner(L, array[index]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -683,6 +865,18 @@ namespace XLua
|
||||
translator.Get(L, obj_idx, out array[array_idx]);
|
||||
return true;
|
||||
}
|
||||
else if (type == typeof(Tutorial.TestEnum[]))
|
||||
{
|
||||
Tutorial.TestEnum[] array = obj as Tutorial.TestEnum[];
|
||||
translator.Get(L, obj_idx, out array[array_idx]);
|
||||
return true;
|
||||
}
|
||||
else if (type == typeof(Tutorial.DerivedClass.TestEnumInner[]))
|
||||
{
|
||||
Tutorial.DerivedClass.TestEnumInner[] array = obj as Tutorial.DerivedClass.TestEnumInner[];
|
||||
translator.Get(L, obj_idx, out array[array_idx]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4077cbfd734acfc489abfa6835fbbb6f
|
||||
guid: 739f3c1f53f9dcf4fa3e067c6f025b74
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -22,96 +22,6 @@ namespace XLua.CSObjectWrap
|
||||
static void wrapInit0(LuaEnv luaenv, ObjectTranslator translator)
|
||||
{
|
||||
|
||||
translator.DelayWrapLoader(typeof(object), SystemObjectWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Object), UnityEngineObjectWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Vector2), UnityEngineVector2Wrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Vector3), UnityEngineVector3Wrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Vector4), UnityEngineVector4Wrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Quaternion), UnityEngineQuaternionWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Color), UnityEngineColorWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Ray), UnityEngineRayWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Bounds), UnityEngineBoundsWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Ray2D), UnityEngineRay2DWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Time), UnityEngineTimeWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.GameObject), UnityEngineGameObjectWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Component), UnityEngineComponentWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Behaviour), UnityEngineBehaviourWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Transform), UnityEngineTransformWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Resources), UnityEngineResourcesWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.TextAsset), UnityEngineTextAssetWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Keyframe), UnityEngineKeyframeWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.AnimationCurve), UnityEngineAnimationCurveWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.AnimationClip), UnityEngineAnimationClipWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.MonoBehaviour), UnityEngineMonoBehaviourWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.ParticleSystem), UnityEngineParticleSystemWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.SkinnedMeshRenderer), UnityEngineSkinnedMeshRendererWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Renderer), UnityEngineRendererWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.WWW), UnityEngineWWWWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Light), UnityEngineLightWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Mathf), UnityEngineMathfWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(System.Collections.Generic.List<int>), SystemCollectionsGenericList_1_SystemInt32_Wrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(UnityEngine.Debug), UnityEngineDebugWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(System.Collections.Hashtable), SystemCollectionsHashtableWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(TableManagerLua), TableManagerLuaWrap.__Register);
|
||||
|
||||
|
||||
@ -124,6 +34,24 @@ namespace XLua.CSObjectWrap
|
||||
translator.DelayWrapLoader(typeof(SdkControl), SdkControlWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(Tutorial.BaseClass), TutorialBaseClassWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(Tutorial.TestEnum), TutorialTestEnumWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(Tutorial.DerivedClass), TutorialDerivedClassWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(Tutorial.DerivedClass.TestEnumInner), TutorialDerivedClassTestEnumInnerWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(Tutorial.ICalc), TutorialICalcWrap.__Register);
|
||||
|
||||
|
||||
translator.DelayWrapLoader(typeof(Tutorial.DerivedClassExtensions), TutorialDerivedClassExtensionsWrap.__Register);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -133,11 +61,7 @@ namespace XLua.CSObjectWrap
|
||||
wrapInit0(luaenv, translator);
|
||||
|
||||
|
||||
translator.AddInterfaceBridgeCreator(typeof(System.Collections.IEnumerator), SystemCollectionsIEnumeratorBridge.__Create);
|
||||
|
||||
translator.AddInterfaceBridgeCreator(typeof(System.Collections.IEnumerable), SystemCollectionsIEnumerableBridge.__Create);
|
||||
|
||||
translator.AddInterfaceBridgeCreator(typeof(IMarketingActRetDel), IMarketingActRetDelBridge.__Create);
|
||||
translator.AddInterfaceBridgeCreator(typeof(Tutorial.CSCallLua.ItfD), TutorialCSCallLuaItfDBridge.__Create);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e17ab85f51fc5ab4890d510baad5f2b5
|
||||
guid: d83e0e59732bbdb4db1b9db468746d60
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
@ -2,61 +2,17 @@
|
||||
|
||||
<linker>
|
||||
|
||||
<assembly fullname="mscorlib">
|
||||
<type fullname="System.Object" preserve="all"/>
|
||||
<type fullname="System.Collections.Generic.List`1[System.Int32]" preserve="all"/>
|
||||
<type fullname="System.Collections.Hashtable" preserve="all"/>
|
||||
|
||||
</assembly>
|
||||
|
||||
<assembly fullname="UnityEngine.CoreModule">
|
||||
<type fullname="UnityEngine.Object" preserve="all"/>
|
||||
<type fullname="UnityEngine.Vector2" preserve="all"/>
|
||||
<type fullname="UnityEngine.Vector3" preserve="all"/>
|
||||
<type fullname="UnityEngine.Vector4" preserve="all"/>
|
||||
<type fullname="UnityEngine.Quaternion" preserve="all"/>
|
||||
<type fullname="UnityEngine.Color" preserve="all"/>
|
||||
<type fullname="UnityEngine.Ray" preserve="all"/>
|
||||
<type fullname="UnityEngine.Bounds" preserve="all"/>
|
||||
<type fullname="UnityEngine.Ray2D" preserve="all"/>
|
||||
<type fullname="UnityEngine.Time" preserve="all"/>
|
||||
<type fullname="UnityEngine.GameObject" preserve="all"/>
|
||||
<type fullname="UnityEngine.Component" preserve="all"/>
|
||||
<type fullname="UnityEngine.Behaviour" preserve="all"/>
|
||||
<type fullname="UnityEngine.Transform" preserve="all"/>
|
||||
<type fullname="UnityEngine.Resources" preserve="all"/>
|
||||
<type fullname="UnityEngine.TextAsset" preserve="all"/>
|
||||
<type fullname="UnityEngine.Keyframe" preserve="all"/>
|
||||
<type fullname="UnityEngine.AnimationCurve" preserve="all"/>
|
||||
<type fullname="UnityEngine.MonoBehaviour" preserve="all"/>
|
||||
<type fullname="UnityEngine.SkinnedMeshRenderer" preserve="all"/>
|
||||
<type fullname="UnityEngine.Renderer" preserve="all"/>
|
||||
<type fullname="UnityEngine.Light" preserve="all"/>
|
||||
<type fullname="UnityEngine.Mathf" preserve="all"/>
|
||||
<type fullname="UnityEngine.Debug" preserve="all"/>
|
||||
|
||||
</assembly>
|
||||
|
||||
<assembly fullname="UnityEngine.AnimationModule">
|
||||
<type fullname="UnityEngine.AnimationClip" preserve="all"/>
|
||||
|
||||
</assembly>
|
||||
|
||||
<assembly fullname="UnityEngine.ParticleSystemModule">
|
||||
<type fullname="UnityEngine.ParticleSystem" preserve="all"/>
|
||||
|
||||
</assembly>
|
||||
|
||||
<assembly fullname="UnityEngine.UnityWebRequestWWWModule">
|
||||
<type fullname="UnityEngine.WWW" preserve="all"/>
|
||||
|
||||
</assembly>
|
||||
|
||||
<assembly fullname="Assembly-CSharp">
|
||||
<type fullname="TableManagerLua" preserve="all"/>
|
||||
<type fullname="LuaMain" preserve="all"/>
|
||||
<type fullname="LuaUIBehaviour" preserve="all"/>
|
||||
<type fullname="SdkControl" preserve="all"/>
|
||||
<type fullname="Tutorial.BaseClass" preserve="all"/>
|
||||
<type fullname="Tutorial.TestEnum" preserve="all"/>
|
||||
<type fullname="Tutorial.DerivedClass" preserve="all"/>
|
||||
<type fullname="Tutorial.DerivedClass+TestEnumInner" preserve="all"/>
|
||||
<type fullname="Tutorial.ICalc" preserve="all"/>
|
||||
<type fullname="Tutorial.DerivedClassExtensions" preserve="all"/>
|
||||
|
||||
</assembly>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0cd9392ac962103468a773fed4e9c5b8
|
||||
guid: 51f4ec9961d636c419a9b02559e1037b
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
Reference in New Issue
Block a user