void Awake()
 {
     foreach (Transform children in transform)
     {
         Unlockable toUnlock = children.GetComponent <Unlockable>();
         if (toUnlock != null && !toUnlock.Equals(null))
         {
             toUnlock.Lock();
         }
     }
 }
Exemple #2
0
    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);
        }
    }