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;
    }
        private void OnInitializeScriptEngine()
        {
            ClassSingleton <AdventureSceneData> .Instance.scriptObjectRoot = new GameObject("ScriptObject");
            Transform transform = ClassSingleton <AdventureSceneData> .Instance.scriptObjectRoot.transform;

            transform.parent        = this.parentTransform;
            transform.localScale    = Vector3.one;
            transform.localPosition = Vector3.zero;
            transform.localRotation = Quaternion.identity;
            TextureTimeScrollRealTime.TimeReset();
            FollowTargetCamera followTargetCamera = UnityEngine.Object.FindObjectOfType <FollowTargetCamera>();

            if (null == followTargetCamera)
            {
                Camera camera3D = ClassSingleton <AdventureSceneData> .Instance.adventureCamera.camera3D;
                camera3D.gameObject.AddComponent <FollowTargetCamera>();
            }
            else
            {
                followTargetCamera.AddCamera(ClassSingleton <AdventureSceneData> .Instance.adventureCamera.camera3D);
            }
            this.isFinishInitialize = true;
        }