chip-gameV3/Assets/Scripts/GameFSM/StartTurnState.cs
2026-07-14 11:14:13 +03:00

53 lines
1.6 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
public class StartTurnState : IState
{
GameObject chip;
GameManager gm;
public void enter()
{
gm = GameManager.instance;
gm.spawnChip();
chip = gm.currentChip;
if (gm.gameMode == GameMode.pvp)//переключаем таймеры только в pvp
{
gm.timerManager.SetActiveTimer(gm.currentPlayer);
LightUtility.Player(gm.currentPlayer);
}
if (chip != null)
{
//первый игрок ходит
if (GameManager.instance.currentPlayer == CellState.Player1)
{
GameManager.instance.stateMachine.ChangeState(new PositioningState());
//GameManager.instance.stateMachine.ChangeState(new BotThinkingState(0));//бот сам с собой
//GameManager.instance.stateMachine.ChangeState(new BotThinkingState(0, gm.MistressPreset));//фишка против ботов
}
else
{
IState nextState;
switch (GameManager.instance.gameMode)
{
case GameMode.pve:
nextState = new BotThinkingState(CharacterController.CurrentCharacter.ThinkTime); break;
case GameMode.pvp:
nextState = new PositioningState(); break;
default:
nextState = new PositioningState(); break;
}
GameManager.instance.stateMachine.ChangeState(nextState);
}
}
}
public void exit()
{
}
public void update()
{
}
}