Files
The_Tower/Assets/Scripts/SpecialChoiceCard.cs
T
IM23a-spirgif 8162e2b331 Initial commit
2025-03-28 20:10:45 +01:00

25 lines
645 B
C#

using UnityEngine;
public class SpecialChoiceCard : MonoBehaviour
{
public UpgradeManager upgradeManager;
void OnMouseDown()
{
// Identify which UpgradeType this card has
UpgradeCard card = GetComponent<UpgradeCard>();
if (card != null)
{
upgradeManager.UnlockSpecialUpgrade(card.upgradeType);
}
// Destroy all other special cards
SpecialChoiceCard[] allChoices = FindObjectsOfType<SpecialChoiceCard>();
foreach (var choice in allChoices)
{
Destroy(choice.gameObject);
}
Time.timeScale = 1f; // Resume game
}
}