#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 CoroutineMgrWrap
|
{
|
public static void __Register(RealStatePtr L)
|
{
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
System.Type type = typeof(CoroutineMgr);
|
Utils.BeginObjectRegister(type, L, translator, 0, 6, 0, 0);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnMainStartCorUp", _m_OnMainStartCorUp);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnMainStopCorUP", _m_OnMainStopCorUP);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "StartBegRank", _m_StartBegRank);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "CanBegRank", _m_CanBegRank);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnMysteriousTask", _m_OnMysteriousTask);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "MainHighTipCdTimeEvent", _e_MainHighTipCdTimeEvent);
|
|
|
|
|
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)
|
{
|
|
CoroutineMgr gen_ret = new CoroutineMgr();
|
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 CoroutineMgr constructor!");
|
|
}
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_OnMainStartCorUp(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
CoroutineMgr gen_to_be_invoked = (CoroutineMgr)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
float __waitingTime = (float)LuaAPI.lua_tonumber(L, 2);
|
|
gen_to_be_invoked.OnMainStartCorUp( __waitingTime );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_OnMainStopCorUP(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
CoroutineMgr gen_to_be_invoked = (CoroutineMgr)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
gen_to_be_invoked.OnMainStopCorUP( );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_StartBegRank(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
CoroutineMgr gen_to_be_invoked = (CoroutineMgr)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
int __type = LuaAPI.xlua_tointeger(L, 2);
|
|
gen_to_be_invoked.StartBegRank( __type );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_CanBegRank(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
CoroutineMgr gen_to_be_invoked = (CoroutineMgr)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
int __type = LuaAPI.xlua_tointeger(L, 2);
|
|
bool gen_ret = gen_to_be_invoked.CanBegRank( __type );
|
LuaAPI.lua_pushboolean(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_OnMysteriousTask(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
CoroutineMgr gen_to_be_invoked = (CoroutineMgr)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
gen_to_be_invoked.OnMysteriousTask( );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _e_MainHighTipCdTimeEvent(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
CoroutineMgr gen_to_be_invoked = (CoroutineMgr)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.MainHighTipCdTimeEvent += gen_delegate;
|
return 0;
|
}
|
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
|
gen_to_be_invoked.MainHighTipCdTimeEvent -= 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 CoroutineMgr.MainHighTipCdTimeEvent!");
|
return 0;
|
}
|
|
|
|
}
|
}
|