#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 TimeDownMgrWrap
|
{
|
public static void __Register(RealStatePtr L)
|
{
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
System.Type type = typeof(TimeDownMgr);
|
Utils.BeginObjectRegister(type, L, translator, 0, 3, 0, 0);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Begin", _m_Begin);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Stop", _m_Stop);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Get", _m_Get);
|
|
|
|
|
|
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)
|
{
|
|
TimeDownMgr gen_ret = new TimeDownMgr();
|
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 TimeDownMgr constructor!");
|
|
}
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_Begin(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
TimeDownMgr gen_to_be_invoked = (TimeDownMgr)translator.FastGetCSObj(L, 1);
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
if(gen_param_count == 5&& translator.Assignable<TimeDownMgr.CoolTimeType>(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)&& translator.Assignable<System.Action<float>>(L, 4)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5))
|
{
|
TimeDownMgr.CoolTimeType _type;translator.Get(L, 2, out _type);
|
float _duration = (float)LuaAPI.lua_tonumber(L, 3);
|
System.Action<float> _func = translator.GetDelegate<System.Action<float>>(L, 4);
|
float _tick = (float)LuaAPI.lua_tonumber(L, 5);
|
|
gen_to_be_invoked.Begin( _type, _duration, _func, _tick );
|
|
|
|
return 0;
|
}
|
if(gen_param_count == 4&& translator.Assignable<TimeDownMgr.CoolTimeType>(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)&& translator.Assignable<System.Action<float>>(L, 4))
|
{
|
TimeDownMgr.CoolTimeType _type;translator.Get(L, 2, out _type);
|
float _duration = (float)LuaAPI.lua_tonumber(L, 3);
|
System.Action<float> _func = translator.GetDelegate<System.Action<float>>(L, 4);
|
|
gen_to_be_invoked.Begin( _type, _duration, _func );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to TimeDownMgr.Begin!");
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_Stop(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
TimeDownMgr gen_to_be_invoked = (TimeDownMgr)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
TimeDownMgr.CoolTimeType _type;translator.Get(L, 2, out _type);
|
|
gen_to_be_invoked.Stop( _type );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_Get(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
TimeDownMgr gen_to_be_invoked = (TimeDownMgr)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
TimeDownMgr.CoolTimeType _type;translator.Get(L, 2, out _type);
|
TimeDownMgr.CoolTimeData _value;
|
|
bool gen_ret = gen_to_be_invoked.Get( _type, out _value );
|
LuaAPI.lua_pushboolean(L, gen_ret);
|
translator.Push(L, _value);
|
|
|
|
|
return 2;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
}
|
}
|