private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.name == "Player")
     {
         if (disableUponHit)
         {
             hitBoxCollider.enabled = false;
         }
         playerStatusManager.ApplyDamage(hitBoxDamage);
         hitboxAudioSource.Play();
     }
 }
Exemple #2
0
 protected override void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.tag == "Player")
     {
         onHitSoundSource.clip = onHitSounds[1];
         onHitSoundSource.Play();
         playerStatusManager.ApplyDamage(25f);
         SetupArrowPlaceholder(other.contacts[0].point, other.relativeVelocity.normalized, other.gameObject);
         return;
     }
     DefaultHit();
     SetupArrowPlaceholder(other.contacts[0].point, other.relativeVelocity.normalized, other.gameObject);
 }