static int LuaManager(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 0);
         VisowFrameWork.LuaManager o = VisowFrameWork.Util.LuaManager();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int LuaGC(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         VisowFrameWork.LuaManager obj = (VisowFrameWork.LuaManager)ToLua.CheckObject <VisowFrameWork.LuaManager>(L, 1);
         obj.LuaGC();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int DoFile(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         VisowFrameWork.LuaManager obj = (VisowFrameWork.LuaManager)ToLua.CheckObject <VisowFrameWork.LuaManager>(L, 1);
         string arg0 = ToLua.CheckString(L, 2);
         obj.DoFile(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int CallFunction(IntPtr L)
 {
     try
     {
         int count = LuaDLL.lua_gettop(L);
         VisowFrameWork.LuaManager obj = (VisowFrameWork.LuaManager)ToLua.CheckObject <VisowFrameWork.LuaManager>(L, 1);
         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));
     }
 }
示例#5
0
        IEnumerator OnStartGame()
        {
            // 移除当前UIRoot
            Manager.Remove <UIRootManager>(ManagerName.UIRoot);
            yield return(new UnityEngine.WaitForEndOfFrame());

            // 清理当前AssetBundle
            ResourceManager resManager = Manager.Add <ResourceManager>(ManagerName.Resource);

            resManager.Close();
            resManager.Initialize();
            yield return(new UnityEngine.WaitForEndOfFrame());

            // 重新加载Lua组件
            LuaManager luaManager = Manager.Add <LuaManager>(ManagerName.Lua);

            luaManager.Close();
            luaManager.ReStart();

            luaManager.DoFile("Main.lua");
        }