Added basic features
This commit is contained in:
28
Assets/Scripts/Manager/EventManager.cs
Normal file
28
Assets/Scripts/Manager/EventManager.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class EventManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private Player _player;
|
||||
[SerializeField]
|
||||
private Goal _goal;
|
||||
|
||||
[SerializeField]
|
||||
private UIManager _uiManager;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_player.OnPlayerDead += OnPlayerDead;
|
||||
_goal.OnGoalReached += OnGoalReached;
|
||||
}
|
||||
|
||||
private void OnPlayerDead()
|
||||
{
|
||||
_uiManager.ShowGameOverPanel();
|
||||
}
|
||||
|
||||
private void OnGoalReached()
|
||||
{
|
||||
_uiManager.ShowSuccessPanel();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user