Exemple #1
0
    public void AddArmor()
    {
        if (playerInventory == null)
        {
            playerInventory = FindObjectOfType <PlayerInventory>();
        }

        if (playerLife == null)
        {
            playerLife = FindObjectOfType <PlayerLife>();
        }

        if (playerInventory.scrap >= addArmorCost)
        {
            playerLife.IncreaseArmor(addArmorAmount);
            playerInventory.AddScrap(-addArmorCost);
        }
    }
Exemple #2
0
 // Insert in these three function the scrap cost
 public void AddArmor(int amount)
 {
     playerLife.IncreaseArmor(amount, true);
     playerInventory.AddMoney(-addArmorCost);
 }