17 lines
342 B
C#
Raw Normal View History

2020-03-15 23:18:29 +01:00
using UnityEngine;
using UnityAtoms.FSM;
public class GameStateDispatcher : MonoBehaviour
{
[SerializeField]
private FiniteStateMachineReference _gameStateRef;
public void DispatchGameOverIfDead(int health)
{
if (health <= 0)
{
_gameStateRef.Machine.Dispatch("SetGameOver");
}
}
}