Example #1
0
        private void OnUnzipFinished(UnzipStatus status)
        {
            if (VersionMgr.Instance.remoteVerCode.Version != VersionMgr.Instance.localCacheVerCode.Version
                /*&& UnzipFailedHandler != null*/)
            {
                Debug.Log("VersionMgr.Instance.remoteVerCode.Version:" + VersionMgr.Instance.remoteVerCode.Version);
                Debug.Log("VersionMgr.Instance.localCacheVerCode.Version:" + VersionMgr.Instance.localCacheVerCode.Version);
                //UnzipFailedHandler(() => { _downloadMgr.transferMgr.DownloadFinished(OnHandlerFinished, UnzipProgressHandler); }, status);
                EventCenter.Broadcast <UnzipStatus, Action>((int)HotUpdateEventType.UnzipFail, status, delegate { _unzipThread.StartUnzip(OnUnzipFinished); });
            }
            else
            {
                EventCenter.Broadcast((int)HotUpdateEventType.UnzipSuccess);
                //OnUpdateComplete();

                endUpdateTime = Utility.GetCurrentUTC() / 1000;

                // 清理即可,不再调用Lua因为马上要执行重启Lua
                Dispose();

                CLogger.Log("GameUpdateMgr::OnUnzipFinished()!");

                // 释放热更界面
                ClearUI();
                // 加载新的资源缓存
                LocalCacheFilesMgr.Instance.LoadCacheFiles();
                // 清理事件
                EventCenter.Cleanup();
                GameUpdateHelper.Instance.ClearListeners();
                // 释放资源
                AssetLoad.ResourceManager.instance.ReleaseAll();
                // 调试,面板也清理一下
                Debuger.DisposeOnRestart();
                // 重启xlua
                LuaManager.instance.ReStart();
            }
        }