/// <summary> /// 更新開始時 /// </summary> void Start() { /// たま生成用乱数シードリセット PzldmManager.Instance?.ResetRandomSeed(); /// 状態遷移初期化 var states = new StateMachine <BattleState> .State[] { new StateMachine <BattleState> .State() { Update = UpdateInit, }, new StateMachine <BattleState> .State() { Enter = EnterReady, Update = UpdateReady, }, new StateMachine <BattleState> .State() { Enter = EnterStart, Update = UpdateStart, }, new StateMachine <BattleState> .State() { Update = UpdatePlaying, }, new StateMachine <BattleState> .State() { Update = UpdateGameOver, }, new StateMachine <BattleState> .State() { Enter = EnterAskContinue, Update = UpdateAskContinue, Leave = LeaveAskContinue, }, new StateMachine <BattleState> .State() { Enter = EnterPaused, Update = UpdatePaused, Leave = LeavePaused, }, }; stateMachine = new StateMachine <BattleState>(states); stateMachine.StartState(BattleState.Init); // COM 作成 //comPlayer = new DefaultComPlayer() comPlayer = new AdvancedComPlayer() { Self = playFields[1], Opponent = playFields[0], #if UNITY_EDITOR ComInfo = comInfo, #endif }; }
/// <summary> /// たま操作開始時 /// </summary> private void StateControlTamaEnter() { // つぎのたまを操作たまにする currentTamaPair[0] = nextTamaPair[0]; currentTamaPair[1] = nextTamaPair[1]; // 操作たまの位置を設定する SetTamaPosition(currentTamaPair[0], setting.startTamaPosition.x, setting.startTamaPosition.y); SetTamaPosition(currentTamaPair[1], setting.startTamaPosition.x, setting.startTamaPosition.y + 1); // つぎのたまを生成する GenerateNextTamaPair(); // 連鎖数をリセット ChainCount = 0; // 自由落下カウンターをリセット tamaFallFrameCount = 0; // 最初はカウンターを0 にしておく //tamaFallFrameCount = TamaFallFrame; // 自由落下速度更新 if ((TamaFallFrame > setting.tamaFallFrameLimit) && (setting.tamaFallFrameUpdateCount > 0) && (tamaGenerator.GeneratedCount % setting.tamaFallFrameUpdateCount == 0)) { --TamaFallFrame; } // ComPlayer リセット ComPlayer?.Start(); }