Esempio n. 1
0
        //携程启动安装
        private IEnumerator UF_coroutine_start_install_game(DelegateMethod callback)
        {
            //清空之前解压的代码文件,避免覆盖安装错误问题
#if !UNITY_EDITOR
            UF_deleteCacheFolder(new DirectoryInfo(GlobalPath.ScriptPath));
#endif
            if (GlobalSettings.InstallMode == "raw")
            {
                //无安装包方式
                UF_logInfo(">>>>>>>>>>>>>>>>>>>> Start Install Raw");
                UpgradeThread rawInstall = new UpgradeThread();
                rawInstall.UF_start(UF_threadInstallRaw, string.Empty);
                yield return(UF_StartCoroutine(rawInstall.UF_check_run_end()));

                UF_logInfo(">>>>>>>>>>>>>>>>>>>> End Install Raw");
                yield return(null);

                if (callback != null)
                {
                    callback(rawInstall.retcode);
                }
            }
            else if (GlobalSettings.InstallMode == "net")
            {
                //安装包下载方式
                UF_logInfo(">>>>>>>>>>>>>>>>>>>> Start Install Net");
                UpgradeThread baseInstall = new UpgradeThread();
                baseInstall.UF_start(UF_threadInstallNet, "base.zip");
                yield return(UF_StartCoroutine(baseInstall.UF_check_run_end()));

                UF_logInfo(">>>>>>>>>>>>>>>>>>>> End Install Net");
                yield return(null);

                if (callback != null)
                {
                    callback(baseInstall.retcode);
                }
            }
            else
            {
                //整包
                UF_logInfo(">>>>>>>>>>>>>>>>>>>> Start Install Base");
                UpgradeThread baseInstall = new UpgradeThread();
                baseInstall.UF_start(UF_threadInstallBase, "base.zip");
                yield return(UF_StartCoroutine(baseInstall.UF_check_run_end()));

                UF_logInfo(">>>>>>>>>>>>>>>>>>>> End Install Base");
                yield return(null);

                if (callback != null)
                {
                    callback(baseInstall.retcode);
                }
            }
        }
Esempio n. 2
0
        private IEnumerator UF_coroutine_start_update_file(List <UpgradeFileInfo> lstUpgrade, DelegateMethod callback)
        {
            UF_logInfo("Start Upgrade File");
            UpgradeThread thread = new UpgradeThread();

            thread.UF_start(UF_thread_updatefile, lstUpgrade);
            yield return(UF_StartCoroutine(thread.UF_check_run_end()));

            if (callback != null)
            {
                callback(thread.retcode == 0);
            }

            UF_logInfo("End Upgrade File");
        }