Beispiel #1
0
 void Update()
 {
     if (cachedMana != GameDataManager.Instance.dataStore.resMana)
     {
         int manaCost = Adventurer.GetPromoteCostForClass(setClass);
         cachedMana              = GameDataManager.Instance.dataStore.resMana;
         reqsText.text           = strings[3] + manaCost + strings[4];
         confirmBtn.interactable = (cachedMana >= manaCost);
     }
 }
Beispiel #2
0
    public void PromoteUnit()
    {
        int manaCost = Adventurer.GetPromoteCostForClass(setClass);

        if (GameDataManager.Instance.SpendManaIfPossible(manaCost))
        {
            adv.PromoteToTier2(setClass);
            shell.Close();
        }
        else
        {
            shell.SurrenderFocus();
            insufficientResourcesPopup.Open();
        }
    }