Exemplo n.º 1
0
 private void Start()
 {
     handler    = FindObjectOfType <PlayerUIHandler>();
     anim       = GetComponent <Animator>();
     controller = GetComponent <PlayerController>();
     handler.UpdateHealth(totalHealth);
 }
Exemplo n.º 2
0
 public void DamageHealth(float dmg)
 {
     if (!isInvulnerable && !controller.GetRolling())
     {
         if (!isDead)
         {
             GetComponent <PlayerCombat>().DisruptFirePunch(false);
             StartCoroutine(BecomeInvulnerable());
             totalHealth -= dmg;
             handler.UpdateHealth(totalHealth);
             if (totalHealth <= 0)
             {
                 HandleDeath();
             }
         }
     }
 }