void Awake() { foreach (Transform children in transform) { Unlockable toUnlock = children.GetComponent <Unlockable>(); if (toUnlock != null && !toUnlock.Equals(null)) { toUnlock.Lock(); } } }
public void BuyPlate() { if (ResourceHandler.instance.allyResource >= unlockCost) { ResourceHandler.instance.allyResource -= unlockCost; GetComponent <Image>().color = boughtColor; bought = true; foreach (Transform children in transform) { Unlockable toUnlock = children.GetComponent <Unlockable>(); if (toUnlock != null && !toUnlock.Equals(null)) { toUnlock.Unlock(); } } buyButton.SetActive(false); } }