コード例 #1
0
ファイル: GameCore.cs プロジェクト: Hengle/LitEngine
        override protected void DisposeNoGcCode()
        {
            if (IsSceneLoading)
            {
                DLog.LogError("异步加载场景未完成时,此时进行卸载GameCore操作,可能引起场景错乱.");
            }
            //公用
            PublicUpdateManager.ClearByKey(AppName);
            NetTool.HttpNet.ClearByKey(AppName);
            NetTool.TCPNet.Instance.ClearAppDelgate(AppName);

            for (int i = mScriptInterfaces.Count - 1; i >= 0; i--)
            {
                ScriptInterface.BehaviourInterfaceBase tscript = mScriptInterfaces[i];
                if (tscript == null)
                {
                    continue;
                }
                if (!tscript.mAppName.Equals(AppName))
                {
                    continue;
                }
                tscript.ClearScriptObject();
            }
            mScriptInterfaces.Clear();

            for (int i = mDontDestroyList.Count - 1; i >= 0; i--)
            {
                DestroyImmediate(mDontDestroyList[i]);
            }
            mDontDestroyList.Clear();

            GManager.DestroyManager();
            AudioManager.DestroyManager();
            LManager.DestroyManager();
            CManager.Dispose();
            SManager.Dispose();

            GManager     = null;
            LManager     = null;
            SManager     = null;
            AudioManager = null;
            CManager     = null;
        }