2020-03-18 02:04:33 +01:00

19 lines
423 B
C#

using UnityEngine;
using UnityAtoms.FSM;
namespace UnityAtoms.Examples
{
public class GameStateDispatcher : MonoBehaviour
{
[SerializeField]
private FiniteStateMachineReference _gameStateRef;
public void DispatchGameOverIfDead(int health)
{
if (health <= 0)
{
_gameStateRef.Machine.Dispatch("SetGameOver");
}
}
}
}