Exemple #1
0
 public void OnHit()
 {
     --hp;
     if (hp <= 0)
     {
         Die();
         return;
     }
     GameMgr.Instance.PlayerMonsterHitSFX();
     hitReact.Begin(Color.red);
     StartCoroutine(HitCoroutine());
 }
Exemple #2
0
 private void OnHit()
 {
     --hp;
     LevelMgr.Instance.RefreshHP();
     if (hp <= 0)
     {
         Die();
         return;
     }
     GameMgr.Instance.PlayPlayerHitSFX();
     spriteRenderer.color = Color.grey;
     hitReact.Begin(Color.white);
     isInvincible = true;
     StartCoroutine(HitCoroutine());
 }