private void OnTriggerEnter2D(Collider2D col) { if (col.CompareTag("Bullet") && !_isInvincible) { StartCoroutine(InvincibilityBlink(maxInvincibilityTime)); _playerScript.DecreaseLife(1); } }
public void Hit() { if (!_isInvincible) { Handheld.Vibrate(); SoundManager.instance.Play(SoundManager.clip.PlayerHit); StartCoroutine(cameraShake.DoShake(0.1f, 0.3f)); StartCoroutine(InvincibilityBlink(maxInvincibilityTime)); _playerScript.DecreaseLife(1); } }