unity-atoms/Examples/Assets/InfinityWaves/GameState/GameStateDispatcher.cs

17 lines
342 B
C#
Raw Normal View History

2020-03-15 18:18:29 -04: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");
}
}
}