示例#1
0
 // Start is called before the first frame update
 public void OnPotionButton()
 {
     if (AddMoney.currentGold >= 10)
     {
         playerUnit.PotionBuy(1);
         AddMoney.gainMoney(-10);
         shopText.text = "Pleasure doing business!";
     }
     else
     {
         shopText.text = "You don't have enough gold, sorry!";
         return;
     }
 }
示例#2
0
 void EndBattle()
 {
     if (state == BattleState.WON)
     {
         dialogueText.text = "You won the battle! You gained " + enemyUnit.Gold + " Gold!";
         AddMoney.gainMoney(enemyUnit.Gold);
         StartCoroutine(Transition());
     }
     else if (state == BattleState.LOST)
     {
         StartCoroutine(DeathTransition());
     }
 }