Finished converting to new UI.
This commit is contained in:
parent
f70f89324b
commit
105055b307
37 changed files with 24044 additions and 1227 deletions
|
|
@ -6,30 +6,24 @@ using Button = UnityEngine.UI.Button;
|
|||
|
||||
public class PassManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Button passButton;
|
||||
|
||||
public event EventHandler PassRequested;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
public event Action PassAvailable;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
passButton.onClick.AddListener(OnPassClicked);
|
||||
GameManager.StateChanged += HandleStateChange;
|
||||
}
|
||||
|
||||
private void HandleStateChange(GameState state) {
|
||||
if (state == GameState.RollDice)
|
||||
{
|
||||
passButton.interactable = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
passButton.interactable = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPassClicked()
|
||||
public void OnPassClicked()
|
||||
{
|
||||
PassRequested?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private void HandleStateChange(GameState state) {
|
||||
if (state != GameState.RollDice)
|
||||
{
|
||||
PassAvailable?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue