Example #1
0
    private void CleanupUpdateResources()
    {
        if (_PanelSplash != null)
        {
            GameObject.Destroy(_PanelSplash);
            _PanelSplash = null;
        }

        if (PanelHotUpdate != null)
        {
            GameObject.Destroy(PanelHotUpdate);
            PanelHotUpdate = null;
        }

        if (_PanelMessageBox != null)
        {
            GameObject.Destroy(_PanelMessageBox);
            _PanelMessageBox = null;
        }

        if (_PanelMonition != null)
        {
            GameObject.Destroy(_PanelMonition);         //If NoUse
            _PanelMonition = null;
        }

        if (_PanelCirle != null)
        {
            GameObject.DestroyImmediate(_PanelCirle);
            _PanelCirle = null;
        }

        //clean up
        GameUpdateMan.Instance.HotUpdateViewer.Destroy();
        GameUpdateMan.ClearInstance();
        ListFilesToCopy = null;

        _UpdateConfigParams       = null;
        _UpdateStringConfigParams = null;
        _UpdatePromotionParams    = null;

        //if (!CAssetBundleManager.IsAssetBundleLoading())
        {
            System.GC.Collect();
            Resources.UnloadUnusedAssets();
        }
    }
Example #2
0
    //显示更新结束前可能出现的错误弹窗
    private IEnumerator ShowErrorMessage(int id)
    {
        if (UpdateStringConfigParams == null)
        {
            _UpdateStringConfigParams = new UpdateStringConfigParams();
            string strUserLanguage = GetUserLanguageCode();
            ReadUpdateStringXmlFromResources(strUserLanguage);
        }
        string title   = null;
        string content = null;

        switch (id)
        {
        case 1:
            title    = UpdateStringConfigParams.PlatformSDKString_InitFailedTitle;
            content  = UpdateStringConfigParams.PlatformSDKString_UnknownErr;
            content += "\n" + string.Format(UpdateStringConfigParams.PlatformSDKString_ErrorCode, "9999");
            break;

        case 2:
            title    = UpdateStringConfigParams.PlatformSDKString_InitFailedTitle;
            content  = UpdateStringConfigParams.PlatformSDKString_NetworkFailure;
            content += "\n" + string.Format(UpdateStringConfigParams.PlatformSDKString_ErrorCode, "9999");
            break;

        case 3:
            title    = UpdateStringConfigParams.PlatformSDKString_InitFailedTitle;
            content  = UpdateStringConfigParams.PlatformSDKString_ServerTimeout;
            content += "\n" + string.Format(UpdateStringConfigParams.PlatformSDKString_ErrorCode, "9999");
            break;

        case 4:
            title    = UpdateStringConfigParams.PlatformSDKString_InitFailedTitle;
            content  = UpdateStringConfigParams.PlatformSDKString_InitializationFailed;
            content += "\n" + string.Format(UpdateStringConfigParams.PlatformSDKString_ErrorCode, "9999");
            break;
        }
        if (!string.IsNullOrEmpty(title) && !string.IsNullOrEmpty(content))
        {
            yield return(new WaitForUserClick(MessageBoxStyle.MB_OK, content, title));
        }
    }