Improved code usabililty of upgrade unlocks

This commit is contained in:
Pasha Bibko
2026-04-14 15:38:20 +01:00
parent 31844bbeee
commit 41431b9aae
4 changed files with 132 additions and 52 deletions

View File

@@ -0,0 +1,21 @@
using UnityEngine;
using UnityEngine.UI;
namespace Fruitomation.Game
{
public class BasicUpgradeButton : MonoBehaviour
{
[Header("Settings")]
[SerializeField] private BasicUpgrade Upgrade;
[SerializeField] private int UpgradeCost;
private void Awake()
{
Button b = GetComponent<Button>();
b.onClick.AddListener(() =>
{
UpgradeManager.Unlock(Upgrade);
});
}
}
}