コード例 #1
0
ファイル: Heal.cs プロジェクト: 266899/Mazee
 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();
     }
 }
コード例 #2
0
ファイル: HealthBar.cs プロジェクト: 266899/Mazee
 // Update is called once per frame
 void Update()
 {
     healthBar.fillAmount = playerScript.playerHealth / 100f;
     potionCounter.text   = potion.GetPotionCount().ToString();
 }