mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-24 09:08:23 -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");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|