Fixed selected chest rewards not being disabled
This commit is contained in:
parent
1f195329a5
commit
5fd3e5bc73
1 changed files with 10 additions and 0 deletions
|
|
@ -11,8 +11,12 @@ namespace UI
|
|||
public event Action ArmorAndDiamondSelected;
|
||||
|
||||
private Button _blackDie;
|
||||
private bool _blackDieAvailable = true;
|
||||
private Button _key;
|
||||
private bool _keyAvailable = true;
|
||||
private Button _armorAndDiamond;
|
||||
private bool _armorAndDiamondAvailable = true;
|
||||
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
|
|
@ -20,27 +24,33 @@ namespace UI
|
|||
|
||||
_blackDie = root.Q<Button>("BlackDie");
|
||||
_blackDie.clicked += () => BlackDieSelected?.Invoke();
|
||||
_blackDie.SetEnabled(_blackDieAvailable);
|
||||
|
||||
_key = root.Q<Button>("Key");
|
||||
_key.clicked += () => KeySelected?.Invoke();
|
||||
_key.SetEnabled(_keyAvailable);
|
||||
|
||||
_armorAndDiamond = root.Q<Button>("ArmorAndDiamond");
|
||||
_armorAndDiamond.clicked += () => ArmorAndDiamondSelected?.Invoke();
|
||||
_armorAndDiamond.SetEnabled(_armorAndDiamondAvailable);
|
||||
}
|
||||
|
||||
public void DisableBlackDie()
|
||||
{
|
||||
_blackDie.SetEnabled(false);
|
||||
_blackDieAvailable = false;
|
||||
}
|
||||
|
||||
public void DisableKey()
|
||||
{
|
||||
_key.SetEnabled(false);
|
||||
_keyAvailable = false;
|
||||
}
|
||||
|
||||
public void DisableArmorAndDiamond()
|
||||
{
|
||||
_armorAndDiamond.SetEnabled(false);
|
||||
_armorAndDiamondAvailable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue