/// <summary> /// /// </summary> /// <param name="h1"></param> /// <param name="h2"></param> /// <param name="isIntersecting"></param> public void DetermineHitboxEnterHitboxEvent(Hitbox h1, Hitbox h2) { bool firstTimeIntersecting = h1.AddIntersectingHitbox(h2); firstTimeIntersecting &= h2.AddIntersectingHitbox(h1); if (h1.hitboxType == Hitbox.HitboxType.Hitbox) { if (h2.hitboxType == Hitbox.HitboxType.Hurtbox) { OnHitboxStayHurtboxEvent(h1, h2); if (firstTimeIntersecting) { OnHitboxEnteredHurtboxEvent(h1, h2); } } else if (h2.hitboxType == Hitbox.HitboxType.Hitbox) { OnHitboxStayHitboxEvent(h1, h2); if (firstTimeIntersecting) { OnHitboxEnterHitboxEvent(h1, h2); } } } else if (h2.hitboxType == Hitbox.HitboxType.Hitbox) { if (h1.hitboxType == Hitbox.HitboxType.Hurtbox) { OnHitboxStayHurtboxEvent(h2, h1); if (firstTimeIntersecting) { OnHitboxEnteredHurtboxEvent(h2, h1); } } } }