Beispiel #1
0
        public static void Init(Action <LuaState> call)
        {
            if (inited)
            {
                return;
            }
            inited           = true;
            registerGameCall = call;
            lua = LuaContext.Create(call);

            LuaStart();
        }
Beispiel #2
0
        private void OnSceneWasLoaded()
        {
            if (!alive)
            {
                return;
            }
            if (loadStatus == LoadSceneStatus.END)
            {
                {
                    loadStatus   = LoadSceneStatus.NONE;
                    sceneLoading = false;

                    LuaContext.RefreshDelegateMap();

#if LUASCRIPT
                    if (luaLoadOverFunc == null)
                    {
                        luaLoadOverFunc = LuaManager.GetFunction("SceneManager.ListenLoadOver");
                    }

                    if (luaLoadOverFunc != null)
                    {
                        LuaManager.CallFunc_VX(luaLoadOverFunc, next);
                    }
#endif
                }
            }
            else if (loadStatus == LoadSceneStatus.BEGIN)
            {
                if (!sceneLoading)
                {
                    sceneLoading = true;

                    if (next != null)
                    {
                        Load();
                    }
                }
            }

            ClearSceneAsset();

            Resources.UnloadUnusedAssets();
            System.GC.Collect();
        }