Esempio n. 1
0
 public void TakeHit()
 {
     health.TakeHit(1);
     StartCoroutine(box.TimedDeactivate(.25f));
     //Flash
     UpdateHealthUI.UpdateHealth(health.MaxHP, health.CurrentHP);
 }
Esempio n. 2
0
 // 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;
 }
Esempio n. 3
0
 void Start()
 {
     player = FindObjectOfType <Player>();
     UpdateHealthUI.UpdateHealth(player.GetComponent <Health>().MaxHP, player.GetComponent <Health>().CurrentHP);
     UpdateCoinUI.UpdateCoinText(Globals.Coins);
 }
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     currentHealth  = maxHealth;
     updateHealthUI = GameObject.FindObjectOfType <UpdateHealthUI>();
     isDamaged      = false;
 }
Esempio n. 5
0
 public void HealPlayer(int amount)
 {
     health.Heal(amount);
     UpdateHealthUI.UpdateHealth(health.MaxHP, health.CurrentHP);
 }