Fucking i haven't slept all night and i got health and water spirits hell yeah

This commit is contained in:
MindfulMinun committed 2022-02-25 08:15:02 -06:00
1 parent 13d7735ad8
commit 9f4c4bba9a
20 files changed
+1540 -504

No files matched your search

+10 -1
View File
@@ -3,16 +3,21 @@ using UnityEngine.Events;
// @MindfulMinun
public class Health : MonoBehaviour {
public int startingHealth;
public int startingHealth = 3;
public int currentHealth;
public bool isInvincible;
public bool isDead;
public Animator healthBarAnimator;
public UnityEvent OnDead;
public UnityEvent OnHit;
void Start() {
OnDead = new UnityEvent();
OnHit = new UnityEvent();
if (healthBarAnimator == null) {
Debug.Log("HealthBarAnimator not found! Please attach the Health bar's animator to the Health script so the health bar can be animated.");
}
currentHealth = startingHealth;
}
void Update() {
@@ -20,6 +25,10 @@ public class Health : MonoBehaviour {
takeHit();
OnHit.Invoke();
}
if (healthBarAnimator != null) {
healthBarAnimator.SetInteger("Health", currentHealth);
}
}
void takeHit() {