public void OnGainHealth(InputValue button)
        {
            Debug.Log("Gain Health");

            playerStats.SetHealth(20);
            playerStats.setMoney(20);
        }
Example #2
0
    public void OnIncrement(InputValue button)
    {
        if (merchantShopPanel.activeSelf)
        {
            if (amountGun < 1 && playerStats.getMoney() >= 100)
            {
                playerStats.setMoney(-100);
                amountGun += 1;
                BouncyLauncherPurchased = true;
                BouncyLauncherImage.SetActive(true);
                gunAmountText.text = "X" + amountGun;
            }
        }

        if (doctorShopPanel.activeSelf)
        {
            if (playerStats.getMoney() >= 50)
            {
                playerStats.setMoney(-50);
                amountBandages              += 1;
                healAmountText.text          = "X" + amountBandages;
                healAmountInventoryText.text = "X" + amountBandages;
            }
        }
    }
Example #3
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         playerStats.setMoney(500);
         end.hasKey = true;
         Destroy(this.gameObject);
     }
 }
Example #4
0
 public void onTakeDamage(float damage)
 {
     health -= damage;
     if (health <= 0)
     {
         playerStats = GameObject.FindGameObjectWithTag("HealthBar").GetComponent <UI_Script>();
         playerStats.setMoney(100);
         Destroy(gameObject);
     }
 }