From 323b0ef4c4a861acb83e5c7f814d5a5ddb4d89ae Mon Sep 17 00:00:00 2001 From: Sveske Juice Date: Sun, 21 Apr 2024 06:17:12 +0200 Subject: [PATCH] show non affordable --- Assets/Scripts/Manager/MoneyManager.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Assets/Scripts/Manager/MoneyManager.cs b/Assets/Scripts/Manager/MoneyManager.cs index c650f30..7120bbd 100644 --- a/Assets/Scripts/Manager/MoneyManager.cs +++ b/Assets/Scripts/Manager/MoneyManager.cs @@ -28,6 +28,16 @@ public class MoneyManager : MonoBehaviour } } + private void Update() + { + // TODO: move to observer patter idgaf rn + for (int i = 0; i < MoneyTexts.Length; i++) + { + float price = towerCollection.Towers[i].price; + MoneyTexts[i].color = GameManager.Instance.Balance.Value >= price ? Color.green : Color.red; + } + } + private void Start() { // Show prices