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

15 lines
311 B
C#

using UnityEngine;
public class GameStateMachine : MonoBehaviour
{
public IState currentState;
public void ChangeState(IState nextState)
{
currentState?.exit();
currentState = nextState;
currentState.enter();
}
private void Update() => currentState?.update();
}