public void TakeHit() { health.TakeHit(1); StartCoroutine(box.TimedDeactivate(.25f)); //Flash UpdateHealthUI.UpdateHealth(health.MaxHP, health.CurrentHP); }
// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); collider = GetComponent <BoxCollider2D>(); audioSource = GetComponent <AudioSource>(); healthScript = GetComponentInChildren <UpdateHealthUI>(); score = 0; currHealth = maxHealth; }
void Start() { player = FindObjectOfType <Player>(); UpdateHealthUI.UpdateHealth(player.GetComponent <Health>().MaxHP, player.GetComponent <Health>().CurrentHP); UpdateCoinUI.UpdateCoinText(Globals.Coins); }
// Use this for initialization void Start() { currentHealth = maxHealth; updateHealthUI = GameObject.FindObjectOfType <UpdateHealthUI>(); isDamaged = false; }
public void HealPlayer(int amount) { health.Heal(amount); UpdateHealthUI.UpdateHealth(health.MaxHP, health.CurrentHP); }