コード例 #1
0
 private void OnTriggerEnter2D(Collider2D col)
 {
     if (col.CompareTag("Bullet") && !_isInvincible)
     {
         StartCoroutine(InvincibilityBlink(maxInvincibilityTime));
         _playerScript.DecreaseLife(1);
     }
 }
コード例 #2
0
 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);
     }
 }