public void OnHit() { --hp; if (hp <= 0) { Die(); return; } GameMgr.Instance.PlayerMonsterHitSFX(); hitReact.Begin(Color.red); StartCoroutine(HitCoroutine()); }
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()); }