29 lines
615 B
C#
29 lines
615 B
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.UIElements;
|
|
using UnityEngine.Video;
|
|
using Button = UnityEngine.UI.Button;
|
|
|
|
public class PassManager : MonoBehaviour
|
|
{
|
|
public event EventHandler PassRequested;
|
|
public event Action PassAvailable;
|
|
|
|
private void OnEnable()
|
|
{
|
|
GameManager.StateChanged += HandleStateChange;
|
|
}
|
|
|
|
public void OnPassClicked()
|
|
{
|
|
PassRequested?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
|
|
private void HandleStateChange(GameState state) {
|
|
if (state != GameState.RollDice)
|
|
{
|
|
PassAvailable?.Invoke();
|
|
}
|
|
}
|
|
|
|
}
|