Пример #1
0
        public override void handlePowerup(GameObject go)
        {
            GameObject playerObj = GameObject.Find("Player");
            Damagable  dam       = playerObj.GetComponent <Damagable>();

            if (dam)
            {
                dam.addMana(mana);
            }
        }
Пример #2
0
 public void Update()
 {
     if (Input.GetKeyDown(spellKeyCode))
     {
         if (m_damagable.getCurrentMana() >= spellCost)
         {
             spellStart();
             m_damagable.addMana(-spellCost);
         }
     }
 }