protected virtual void ButtonTwoPressed(object sender, ControllerInteractionEventArgs e) { state = !state; if (potion.GetPotionCount() > 0) { FindObjectOfType <AudioManager>().Play("Drinking"); Debug.Log("heal"); playerScript.playerHealth += 30f; potion.RemovePotion(); } }
// Update is called once per frame void Update() { healthBar.fillAmount = playerScript.playerHealth / 100f; potionCounter.text = potion.GetPotionCount().ToString(); }