Files
CityBuilder/Assets/Scripts/StateMachine.cs
SHOUTING_PIRATE 1c91215efd initial commit
2025-07-07 20:59:04 +01:00

19 lines
350 B
C#

using System.Collections.Generic;
using UnityEngine;
public class StateMachine : MonoBehaviour
{
private State currentState;
public void SetState(State newState)
{
currentState?.Exit();
currentState = newState;
currentState?.Enter();
}
private void Update()
{
currentState?.Update();
}
}