protected override IEnumerator MainRoutine() { BattleObjectPooler.CallInitialize(); BattleObjectPooler.isCheckEnable = false; TextureTimeScrollRealTime.TimeReset(); this.SetLoadingImage(true); this.SetActiveHierarcyRendering(false); base.stateManager.initialize.InitializeRoots(); base.battleStateData.beforeConfirmDigiStoneNumber = base.hierarchyData.digiStoneNumber; List <IEnumerator> functionList = new List <IEnumerator>(); functionList.Add(this.LoadBeforeInitializeUI()); functionList.Add(this.InitSound()); functionList.Add(this.CheckRecover()); functionList.Add(this.LoadResources()); functionList.Add(this.LoadPlayer()); functionList.Add(this.LoadEnemy()); functionList.Add(this.LoadCharacterAfter()); functionList.Add(this.LoadCommonEffect()); functionList.Add(this.LoadSkill()); functionList.Add(this.LoadAfterInitializeUI()); Action loading = base.stateManager.battleUiComponents.initializeUi.GetLoadingInvoke(functionList.Count); TimeProfiler.BeginTotalProfile(); foreach (IEnumerator function in functionList) { TimeProfiler.BeginProfile(); while (function.MoveNext()) { yield return(null); } loading(); yield return(new WaitForEndOfFrame()); TimeProfiler.EndProfile(); DkLog.W(string.Format("経過時間 : {0} | {1}", TimeProfiler.ElapseTime, function), false); } TimeProfiler.EndTotalProfile(); DkLog.W(string.Format("経過時間(total) : {0}", TimeProfiler.TotalElapseTime), false); for (int i = 0; i < base.hierarchyData.usePlayerCharacters.Length; i++) { bool isLeade = i == base.hierarchyData.leaderCharacter; CharacterStateControl characterStateControl = base.battleStateData.playerCharacters[i]; string resourcePath = GUIMonsterIcon.InternalGetMonsterIconPathByIconId(characterStateControl.playerStatus.thumbnailId); string monsterIconPathByIconId = GUIMonsterIcon.GetMonsterIconPathByIconId(characterStateControl.playerStatus.thumbnailId); base.stateManager.uiControl.ApplyMonsterButtonIcon(i, characterStateControl, isLeade, resourcePath, monsterIconPathByIconId); } BattleDebug.Log("--- バトルGC : 開始"); Resources.UnloadUnusedAssets(); GC.Collect(); BattleDebug.Log("--- バトルGC : 完了"); this.SetActiveHierarcyRendering(true); this.SetLoadingImage(false); base.stateManager.uiControl.SetTouchEnable(true); base.stateManager.SetBattleScreen(BattleScreen.BattleStartAction); base.stateManager.battleUiComponents.InitSafeArea(); yield break; }
public IEnumerator LoadAlwaysEffect(string effectId, int index, Action <AlwaysEffectParams, int> result) { BattleDebug.Log(string.Concat(new object[] { "--- 常設エフェクト単体ロード effectId[", effectId, "] index[", index, "] : 開始" })); AlwaysEffectParams alwaysParam = null; GameObject effect = null; if (!BattleObjectPooler.TryGetAlwaysEffectParams(effectId, index, out alwaysParam)) { GameObject prefab = base.stateManager.serverControl.GetAlwaysEffectPrefab(effectId); effect = base.Instantiate <GameObject>(prefab); yield return(null); effect.name = effectId; alwaysParam = effect.GetComponent <AlwaysEffectParams>(); BattleObjectPooler.AddAlwaysEffectParams(effectId, alwaysParam); } else { effect = alwaysParam.gameObject; } effect.transform.SetParent(base.battleStateData.alwaysEffectRoot); effect.transform.position = Vector3.zero; effect.transform.rotation = Quaternion.identity; IEnumerator initialize = alwaysParam.Initialize(base.hierarchyData.cameraObject.camera3D); while (initialize.MoveNext()) { yield return(null); } base.stateManager.threeDAction.StopAlwaysEffectAction(new AlwaysEffectParams[] { alwaysParam }); base.stateManager.soundPlayer.AddEffectSe(alwaysParam.inSeId); base.stateManager.soundPlayer.AddEffectSe(alwaysParam.alwaysSeId); base.stateManager.soundPlayer.AddEffectSe(alwaysParam.outSeId); result(alwaysParam, index); BattleDebug.Log(string.Concat(new object[] { "--- 常設エフェクト単体ロード effectId[", effectId, "] index[", index, "] : 完了" })); yield break; }
public IEnumerator LoadHitEffect(string effectId, int index, Action <HitEffectParams, int> result) { BattleDebug.Log(string.Concat(new object[] { "-- ヒットエフェクト単体ロード effectId[", effectId, "] index[", index, "] : 開始" })); HitEffectParams hitEffectParams = null; GameObject hitEffect = null; if (!BattleObjectPooler.TryGetHitEffectParams(effectId, index, out hitEffectParams)) { GameObject prefab = base.stateManager.serverControl.GetHitEffectPrefab(effectId); hitEffect = base.Instantiate <GameObject>(prefab); yield return(null); hitEffect.name = effectId; hitEffectParams = hitEffect.GetComponent <HitEffectParams>(); BattleObjectPooler.AddHitEffectParams(effectId, hitEffectParams); } else { hitEffect = hitEffectParams.gameObject; } hitEffect.transform.SetParent(base.battleStateData.hitEffectRoot); hitEffect.SetActive(false); IEnumerator initialize = hitEffectParams.Initialize(base.hierarchyData.cameraObject.camera3D); while (initialize.MoveNext()) { yield return(null); } base.stateManager.soundPlayer.AddEffectSe(hitEffectParams.seId); result(hitEffectParams, index); BattleDebug.Log(string.Concat(new object[] { "-- ヒットエフェクト単体ロード effectId[", effectId, "] index[", index, "] : 完了" })); yield break; }