Files
JJBB/Assets/XLua/Gen/DelegatesGensBridge.cs

116 lines
3.2 KiB
C#
Raw Permalink Normal View History

2024-08-23 15:49:34 +08:00
#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
{
2024-09-04 02:07:48 +08:00
public void __Gen_Delegate_Imp0(bool p0, object p1, UnityEngine.GameObject p2)
2024-08-23 15:49:34 +08:00
{
#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;
2024-09-04 02:07:48 +08:00
LuaAPI.lua_pushboolean(L, p0);
translator.PushAny(L, p1);
translator.Push(L, p2);
2024-08-23 15:49:34 +08:00
2024-09-04 02:07:48 +08:00
PCall(L, 3, 0, errFunc);
2024-08-23 15:49:34 +08:00
LuaAPI.lua_settop(L, errFunc - 1);
#if THREAD_SAFE || HOTFIX_ENABLE
}
#endif
}
2024-09-04 02:07:48 +08:00
public int __Gen_Delegate_Imp1(int p0, string p1, out Tutorial.CSCallLua.DClass p2)
2024-08-23 15:49:34 +08:00
{
#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;
2024-09-04 02:07:48 +08:00
LuaAPI.xlua_pushinteger(L, p0);
LuaAPI.lua_pushstring(L, p1);
2024-08-23 15:49:34 +08:00
2024-09-04 02:07:48 +08:00
PCall(L, 2, 2, errFunc);
2024-08-23 15:49:34 +08:00
2024-09-04 02:07:48 +08:00
p2 = (Tutorial.CSCallLua.DClass)translator.GetObject(L, errFunc + 2, typeof(Tutorial.CSCallLua.DClass));
2024-08-23 15:49:34 +08:00
2024-09-04 02:07:48 +08:00
int __gen_ret = LuaAPI.xlua_tointeger(L, errFunc + 1);
2024-08-23 15:49:34 +08:00
LuaAPI.lua_settop(L, errFunc - 1);
2024-09-04 02:07:48 +08:00
return __gen_ret;
2024-08-23 15:49:34 +08:00
#if THREAD_SAFE || HOTFIX_ENABLE
}
#endif
}
2024-09-04 02:07:48 +08:00
public System.Action __Gen_Delegate_Imp2()
2024-08-23 15:49:34 +08:00
{
#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;
2024-09-04 02:07:48 +08:00
PCall(L, 0, 1, errFunc);
2024-08-23 15:49:34 +08:00
2024-09-04 02:07:48 +08:00
System.Action __gen_ret = translator.GetDelegate<System.Action>(L, errFunc + 1);
2024-08-23 15:49:34 +08:00
LuaAPI.lua_settop(L, errFunc - 1);
2024-09-04 02:07:48 +08:00
return __gen_ret;
2024-08-23 15:49:34 +08:00
#if THREAD_SAFE || HOTFIX_ENABLE
}
#endif
}
static DelegateBridge()
{
Gen_Flag = true;
}
public override Delegate GetDelegateByType(Type type)
{
2024-09-04 02:07:48 +08:00
if (type == typeof(LuaUIManager.OnOpenUIDelegate))
2024-08-23 15:49:34 +08:00
{
2024-09-04 02:07:48 +08:00
return new LuaUIManager.OnOpenUIDelegate(__Gen_Delegate_Imp0);
2024-08-23 15:49:34 +08:00
}
2024-09-04 02:07:48 +08:00
if (type == typeof(Tutorial.CSCallLua.FDelegate))
2024-08-23 15:49:34 +08:00
{
2024-09-04 02:07:48 +08:00
return new Tutorial.CSCallLua.FDelegate(__Gen_Delegate_Imp1);
2024-08-23 15:49:34 +08:00
}
2024-09-04 02:07:48 +08:00
if (type == typeof(Tutorial.CSCallLua.GetE))
2024-08-23 15:49:34 +08:00
{
2024-09-04 02:07:48 +08:00
return new Tutorial.CSCallLua.GetE(__Gen_Delegate_Imp2);
2024-08-23 15:49:34 +08:00
}
return null;
}
}
}