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