private void BootingSystemOver() { //这里GameRoot的初始化在GameRoot的静态构造函数里 //这里需要检测GameRoot是否加载完成了 GameRoot.GameRootInitializationSucceedEvent += OnGameRootInitializationSucceed; GameRoot.StartInitialization(); }
IEnumerator DelayJingRuiJiaMiJiaoYan() { Debug.Log("Start JingRui JiaMi test..."); yield return(new WaitForSeconds(5f)); GameRoot.StartInitialization(); StandbyProcess sp = new StandbyProcess(); sp.Initialization(); }
protected virtual IEnumerator BootingSystem() { //重新设置资源加载模式 UniGameResources.gameResourcesWorkMode = UniGameResources.GameResourcesWorkMode.Mode_Mobile; //语言支持模式 UniGameResources.gameResourcesWorkModeTwo = UniGameResources.GameResourcesWorkModeTwo.Mode_OutGameOptions; //更换成当前的资源加载支持对象 UniGameResources.uniGameResourcesSupport = new IUniGameResourcesSupport(); //启动协同程序装载包清单文件 UniGameResources.AllocResourcesDownLoadWorker(); yield return(StartCoroutine(UniGameResources.resourcesDownLoadWorker.LoadingGameAssetBundleInventoryPackageFile())); //显示启动页面 yield return(StartCoroutine(OpenGameBootFace())); //检测当前程序版本是否符合资源版本的要求 if (UniGameResources.produceInformation.SupportProgramVersion != UniGameResources.uniGameResourcesSupport.ProgramVersion) { bootingSystemStep = BootingSystemStep.Step_NeedInstallNewVersionProgram; yield break; } //装载要求强制装载的包,这些包不再卸载 List <string> packageList = new List <string>(8); Dictionary <uint, UniGameResourcesPackage> .Enumerator list = UniGameResources.systemResourcesPackageTable.GetEnumerator(); while (list.MoveNext()) { if (list.Current.Value.assetBundleExistType == UniGameResourcesPackage.AssetBundleExistType.ExistType_ConstraintInstall) { packageList.Add(list.Current.Value.packageName); } } list.Dispose(); if (packageList.Count != 0) { bootingSystemStep = BootingSystemStep.Step_ConstraintInstallPackage; constraintInstallDownloader = UniGameResources.resourcesDownLoadWorker.AllocResourcesDownLoader_DontDestroyOnLoad(); yield return(StartCoroutine(constraintInstallDownloader.DownloadPackageWithList(packageList))); } //进行强制下载的资源包 List <UniGameResourcesPackage> ConstraintDownloadPackageList = UniGameResources.ComparisonSystemResourcesPackageVersion(); if (ConstraintDownloadPackageList.Count != 0) { bootingSystemStep = BootingSystemStep.Step_ConstraintDownloadPackage; constraintDownloadDownloader = UniGameResources.resourcesDownLoadWorker.AllocResourcesDownLoader(); yield return(StartCoroutine(constraintDownloadDownloader.DownloadPackageWithList(ConstraintDownloadPackageList))); //下载完是需要卸载的 UniGameResources.resourcesDownLoadWorker.ReleaseResourcesDownLoader(constraintDownloadDownloader); constraintDownloadDownloader = null; } //保存一次当前资源包版本 UniGameResources.SaveSystemResourcesPackageVersion(); //全部处理完毕 bootingSystemStep = BootingSystemStep.Step_BootingOver; //示范代码下载并加载一个资源包内的场景 //yield return StartCoroutine(UniGameResources.resourcesDownLoadWorker.LoadingGameSceneLevelAdditiveAsync("scene_game", "game")); //资源加载工作全部完成,开始初始化程序 //这里GameRoot的初始化在GameRoot的静态构造函数里 //这里需要检测GameRoot是否加载完成了 GameRoot.GameRootInitializationSucceedEvent += OnGameRootInitializationSucceed; GameRoot.StartInitialization(); }
//改成Start初始化,不然Awake 不能初始化系统Time protected override void Start() { base.Start(); GameRoot.StartInitialization(); GameRoot.RegisterScene(this); }
//改成Start初始化,不然Awake 不能初始化系统Time protected virtual void Start() { GameRoot.StartInitialization(); GameRoot.RegisterScene(this); }