mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-24 00:58:59 -05:00
17 lines
342 B
C#
17 lines
342 B
C#
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");
|
|
}
|
|
}
|
|
}
|