116 lines
3.2 KiB
C#
116 lines
3.2 KiB
C#
#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 System;
|
|
|
|
|
|
namespace XLua
|
|
{
|
|
public partial class DelegateBridge : DelegateBridgeBase
|
|
{
|
|
|
|
public void __Gen_Delegate_Imp0(bool p0, object p1, UnityEngine.GameObject p2)
|
|
{
|
|
#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;
|
|
LuaAPI.lua_pushboolean(L, p0);
|
|
translator.PushAny(L, p1);
|
|
translator.Push(L, p2);
|
|
|
|
PCall(L, 3, 0, errFunc);
|
|
|
|
|
|
|
|
LuaAPI.lua_settop(L, errFunc - 1);
|
|
|
|
#if THREAD_SAFE || HOTFIX_ENABLE
|
|
}
|
|
#endif
|
|
}
|
|
|
|
public int __Gen_Delegate_Imp1(int p0, string p1, out Tutorial.CSCallLua.DClass p2)
|
|
{
|
|
#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;
|
|
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
|
|
}
|
|
|
|
|
|
static DelegateBridge()
|
|
{
|
|
Gen_Flag = true;
|
|
}
|
|
|
|
public override Delegate GetDelegateByType(Type type)
|
|
{
|
|
|
|
if (type == typeof(LuaUIManager.OnOpenUIDelegate))
|
|
{
|
|
return new LuaUIManager.OnOpenUIDelegate(__Gen_Delegate_Imp0);
|
|
}
|
|
|
|
if (type == typeof(Tutorial.CSCallLua.FDelegate))
|
|
{
|
|
return new Tutorial.CSCallLua.FDelegate(__Gen_Delegate_Imp1);
|
|
}
|
|
|
|
if (type == typeof(Tutorial.CSCallLua.GetE))
|
|
{
|
|
return new Tutorial.CSCallLua.GetE(__Gen_Delegate_Imp2);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|
|
} |