Jeremy Smitherman 1523485fe2 feat/state (#2)
Reviewed-on: #2
Co-authored-by: Jeremy Smitherman <Jeremysmitherman@gmail.com>
Co-committed-by: Jeremy Smitherman <Jeremysmitherman@gmail.com>
2026-04-24 18:57:06 +00:00

28 lines
856 B
C#

using UnityEngine;
namespace State
{
/// <summary>
/// State that drives the engine. OnEnter, OnUpdate, OnFixedUpdate, and OnExit called by parent state machine
/// </summary>
public class GameState
{
protected Machine StateMachine;
/// <summary>
/// Called when parent state machine loads this state.
/// Gives a reference to the parent state machine to the state.
/// </summary>
/// <param name="machine"></param>
public virtual void OnEnter(Machine machine)
{
StateMachine = machine;
}
// Called when parent StateMachine ChangeState is about to leave this state
public virtual void OnExit() {}
public virtual void OnUpdate(float deltaTime) {}
public virtual void OnFixedUpdate(float deltaTime) {}
}
}