Ejemplo n.º 1
0
        void OnTriggerEnter(Collider other)
        {
            if (!other.CompareTag(Tags.Hitbox))
            {
                return;
            }
            Hitbox otherHitbox = other.GetComponent <Hitbox>();

            if (otherHitbox == null || !ReactionMatrix.ContainsKey(type, otherHitbox.type))
            {
                return;
            }
            HitboxResolver.AddCollision(this, otherHitbox);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// OnTriggerEnter is called when the Collider other enters the trigger.
        /// </summary>
        /// <param name="other">The other Collider involved in this collision.</param>
        void OnTriggerEnter(Collider other)
        {
            if (!other.CompareTag(Config.Tags.HitboxTag))
            {
                return;
            }
            var otherHitbox = other.GetComponent <Hitbox>();

            if (otherHitbox == null || !ReactionMatrix.ContainsKey(CurrentType, otherHitbox.CurrentType))
            {
                return;
            }
            if (CheckHistory(other) || CheckHistory(otherHitbox) || CheckHistory(otherHitbox.Damageable) || CheckHistory(otherHitbox.Knockbackable))
            {
                return;
            }
            HitboxResolver.AddCollision(this, otherHitbox);
        }