Added the unlock menu thing
This commit is contained in:
@@ -106,20 +106,15 @@ namespace Fruitomation.UI
|
||||
UpgradeLines = lines.ToArray();
|
||||
}
|
||||
|
||||
private void OnButtonClicked()
|
||||
{
|
||||
if (Cost == 0f)
|
||||
{
|
||||
Debug.LogWarning("Upgrade Cost has not been set");
|
||||
return;
|
||||
}
|
||||
|
||||
if (MoneyController.CanBuy(Cost))
|
||||
{
|
||||
UpgradeManager.Unlock(Upgrade);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnButtonClicked() => UpgradeBoard.Enable
|
||||
(
|
||||
Upgrade,
|
||||
Inputs,
|
||||
Outputs,
|
||||
Building,
|
||||
Cost
|
||||
);
|
||||
|
||||
private bool IsUnlockable =>
|
||||
RequiredUpgrades.Length == 0 ||
|
||||
RequiredUpgrades.All(required => required.IsUnlocked);
|
||||
@@ -170,7 +165,8 @@ namespace Fruitomation.UI
|
||||
State = UpgradeState.Hidden;
|
||||
}
|
||||
|
||||
AttachedButton.interactable = State == UpgradeState.Unlockable;
|
||||
AttachedButton.interactable =
|
||||
State is UpgradeState.Unlockable or UpgradeState.Unlocked;
|
||||
|
||||
string cost = Cost == 0f ? "UNAVAILABLE" : $"{Cost:F1}";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user