implement more changes

This commit is contained in:
2026-05-27 00:04:52 +02:00
parent e460a69443
commit 93a2f0e08c
27 changed files with 5825 additions and 5842 deletions
+5 -7
View File
@@ -6,20 +6,18 @@ public class SpecialChoiceCard : MonoBehaviour
void OnMouseDown()
{
// Identify which UpgradeType this card has
UpgradeCard card = GetComponent<UpgradeCard>();
if (card != null)
if (card != null && upgradeManager != null)
{
upgradeManager.UnlockSpecialUpgrade(card.upgradeType);
upgradeManager.TryUpgrade(card.upgradeType);
}
// Destroy all other special cards
SpecialChoiceCard[] allChoices = FindObjectsOfType<SpecialChoiceCard>();
SpecialChoiceCard[] allChoices = FindObjectsByType<SpecialChoiceCard>();
foreach (var choice in allChoices)
{
Destroy(choice.gameObject);
}
Time.timeScale = 1f; // Resume game
Time.timeScale = 1f;
}
}
}