static int Close(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); MyFrameWork.LuaManager obj = (MyFrameWork.LuaManager)ToLua.CheckObject(L, 1, typeof(MyFrameWork.LuaManager)); obj.Close(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int DoFile(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); MyFrameWork.LuaManager obj = (MyFrameWork.LuaManager)ToLua.CheckObject(L, 1, typeof(MyFrameWork.LuaManager)); string arg0 = ToLua.CheckString(L, 2); object[] o = obj.DoFile(arg0); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int CallFunction(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); MyFrameWork.LuaManager obj = (MyFrameWork.LuaManager)ToLua.CheckObject(L, 1, typeof(MyFrameWork.LuaManager)); string arg0 = ToLua.CheckString(L, 2); object[] arg1 = ToLua.ToParamsObject(L, 3, count - 2); object[] o = obj.CallFunction(arg0, arg1); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <summary> /// 析构函数 /// </summary> void OnDestroy() { EventDispatcher.RemoveListener("OpponentReady", OnServerMatched); EventDispatcher.RemoveListener("MatchUIReady", OnMatchUIShowed); EventDispatcher.RemoveListener("MatchUICanceled", OnMatchUICanceled); EventDispatcher.RemoveListener("DelMatchedInfo", OnDelMatchedInfo); if (NetManager != null) { NetManager.Unload(); } if (LuaManager != null) { LuaManager.Close(); } DebugUtil.Info("~GameManager was destroyed"); }
/// <summary> /// 资源初始化结束 /// </summary> public void OnResourceInited() { LuaManager.InitStart(); LuaManager.DoFile("Logic/Game"); //加载游戏 LuaManager.DoFile("Logic/Network"); //加载网络 //初始化网络 if (GameEntrance.Instance.IsTestFight) { StartCoroutine(ToFightScene()); //加载表格 AppFacade.Instance.GetManager <TutorialManager>(ManagerName.Tutorial).LoadTutorialTable(); initialize = true; //初始化完 } else { MyHttp.Instance.RequestVerInfo(OnVerInfoLoaded); } }