#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 TimeMgrWrap
|
{
|
public static void __Register(RealStatePtr L)
|
{
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
System.Type type = typeof(TimeMgr);
|
Utils.BeginObjectRegister(type, L, translator, 0, 7, 1, 1);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Register", _m_Register);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetInterval", _m_SetInterval);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "UnRegister", _m_UnRegister);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnDayEvent", _e_OnDayEvent);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnHourEvent", _e_OnHourEvent);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnMinuteEvent", _e_OnMinuteEvent);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnSyntonyEvent", _e_OnSyntonyEvent);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "dayBuff", _g_get_dayBuff);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "dayBuff", _s_set_dayBuff);
|
|
|
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)
|
{
|
|
TimeMgr gen_ret = new TimeMgr();
|
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 TimeMgr constructor!");
|
|
}
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_Register(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
TimeMgr gen_to_be_invoked = (TimeMgr)translator.FastGetCSObj(L, 1);
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
if(gen_param_count == 4&& translator.Assignable<TimeMgr.SyntonyType>(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)&& translator.Assignable<System.Action>(L, 4))
|
{
|
TimeMgr.SyntonyType _type;translator.Get(L, 2, out _type);
|
float __totalTime = (float)LuaAPI.lua_tonumber(L, 3);
|
System.Action __func = translator.GetDelegate<System.Action>(L, 4);
|
|
gen_to_be_invoked.Register( _type, __totalTime, __func );
|
|
|
|
return 0;
|
}
|
if(gen_param_count == 3&& translator.Assignable<TimeMgr.SyntonyType>(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
|
{
|
TimeMgr.SyntonyType _type;translator.Get(L, 2, out _type);
|
float __totalTime = (float)LuaAPI.lua_tonumber(L, 3);
|
|
gen_to_be_invoked.Register( _type, __totalTime );
|
|
|
|
return 0;
|
}
|
if(gen_param_count == 5&& translator.Assignable<UnityEngine.Component>(L, 2)&& translator.Assignable<System.Action<UnityEngine.Component>>(L, 3)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5))
|
{
|
UnityEngine.Component _comp = (UnityEngine.Component)translator.GetObject(L, 2, typeof(UnityEngine.Component));
|
System.Action<UnityEngine.Component> _func = translator.GetDelegate<System.Action<UnityEngine.Component>>(L, 3);
|
float _t = (float)LuaAPI.lua_tonumber(L, 4);
|
int _loopCnt = LuaAPI.xlua_tointeger(L, 5);
|
|
gen_to_be_invoked.Register( _comp, _func, _t, _loopCnt );
|
|
|
|
return 0;
|
}
|
if(gen_param_count == 4&& translator.Assignable<UnityEngine.Component>(L, 2)&& translator.Assignable<System.Action<UnityEngine.Component>>(L, 3)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4))
|
{
|
UnityEngine.Component _comp = (UnityEngine.Component)translator.GetObject(L, 2, typeof(UnityEngine.Component));
|
System.Action<UnityEngine.Component> _func = translator.GetDelegate<System.Action<UnityEngine.Component>>(L, 3);
|
float _t = (float)LuaAPI.lua_tonumber(L, 4);
|
|
gen_to_be_invoked.Register( _comp, _func, _t );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to TimeMgr.Register!");
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_SetInterval(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
TimeMgr gen_to_be_invoked = (TimeMgr)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
UnityEngine.Component _comp = (UnityEngine.Component)translator.GetObject(L, 2, typeof(UnityEngine.Component));
|
float _t = (float)LuaAPI.lua_tonumber(L, 3);
|
|
gen_to_be_invoked.SetInterval( _comp, _t );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_UnRegister(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
TimeMgr gen_to_be_invoked = (TimeMgr)translator.FastGetCSObj(L, 1);
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
if(gen_param_count == 2&& translator.Assignable<UnityEngine.Component>(L, 2))
|
{
|
UnityEngine.Component _comp = (UnityEngine.Component)translator.GetObject(L, 2, typeof(UnityEngine.Component));
|
|
gen_to_be_invoked.UnRegister( _comp );
|
|
|
|
return 0;
|
}
|
if(gen_param_count == 2&& translator.Assignable<TimeMgr.SyntonyType>(L, 2))
|
{
|
TimeMgr.SyntonyType _type;translator.Get(L, 2, out _type);
|
|
gen_to_be_invoked.UnRegister( _type );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to TimeMgr.UnRegister!");
|
|
}
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _g_get_dayBuff(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
TimeMgr gen_to_be_invoked = (TimeMgr)translator.FastGetCSObj(L, 1);
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.dayBuff);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _s_set_dayBuff(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
TimeMgr gen_to_be_invoked = (TimeMgr)translator.FastGetCSObj(L, 1);
|
gen_to_be_invoked.dayBuff = 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 _e_OnDayEvent(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
TimeMgr gen_to_be_invoked = (TimeMgr)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.OnDayEvent += gen_delegate;
|
return 0;
|
}
|
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
|
gen_to_be_invoked.OnDayEvent -= 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 TimeMgr.OnDayEvent!");
|
return 0;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _e_OnHourEvent(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
TimeMgr gen_to_be_invoked = (TimeMgr)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.OnHourEvent += gen_delegate;
|
return 0;
|
}
|
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
|
gen_to_be_invoked.OnHourEvent -= 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 TimeMgr.OnHourEvent!");
|
return 0;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _e_OnMinuteEvent(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
TimeMgr gen_to_be_invoked = (TimeMgr)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.OnMinuteEvent += gen_delegate;
|
return 0;
|
}
|
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
|
gen_to_be_invoked.OnMinuteEvent -= 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 TimeMgr.OnMinuteEvent!");
|
return 0;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _e_OnSyntonyEvent(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
TimeMgr gen_to_be_invoked = (TimeMgr)translator.FastGetCSObj(L, 1);
|
System.Action<TimeMgr.SyntonyType> gen_delegate = translator.GetDelegate<System.Action<TimeMgr.SyntonyType>>(L, 3);
|
if (gen_delegate == null) {
|
return LuaAPI.luaL_error(L, "#3 need System.Action<TimeMgr.SyntonyType>!");
|
}
|
|
if (gen_param_count == 3)
|
{
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "+")) {
|
gen_to_be_invoked.OnSyntonyEvent += gen_delegate;
|
return 0;
|
}
|
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
|
gen_to_be_invoked.OnSyntonyEvent -= 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 TimeMgr.OnSyntonyEvent!");
|
return 0;
|
}
|
|
|
|
}
|
}
|