예제 #1
0
        /// <summary>
        /// An object has entered the trigger.
        /// </summary>
        /// <param name="other">The object that entered the trigger.</param>
        private void OnTriggerEnter(Collider other)
        {
            // A main character collider is required.
            if (!MathUtility.InLayerMask(other.gameObject.layer, 1 << LayerManager.Character)) {
                return;
            }

            m_DemoManager.EnteredTriggerZone(this, other.gameObject);
        }
예제 #2
0
        /// <summary>
        /// An object has entered the trigger.
        /// </summary>
        /// <param name="other">The object that entered the trigger.</param>
        private void OnTriggerEnter(Collider other)
        {
            // A main character collider is required.
            if (!MathUtility.InLayerMask(other.gameObject.layer, 1 << LayerManager.Character))
            {
                return;
            }

            // Only enter the trigger if the object is a character (and not the horse).
            if (other.gameObject.GetCachedParentComponent <UltimateCharacterLocomotion>() == null || other.gameObject.GetCachedParentComponent <LocalLookSource>() != null)
            {
                return;
            }

            m_DemoManager.EnteredTriggerZone(this);
        }
예제 #3
0
        /// <summary>
        /// An object has entered the trigger.
        /// </summary>
        /// <param name="other">The object that entered the trigger.</param>
        private void OnTriggerEnter(Collider other)
        {
            // A main character collider is required.
            if (!MathUtility.InLayerMask(other.gameObject.layer, 1 << LayerManager.Character))
            {
                return;
            }

            // AI and remote networked characters should not trigger the zone.
            var characterLocomotion = other.gameObject.GetCachedParentComponent <UltimateCharacterLocomotion>();

            if (characterLocomotion == null || characterLocomotion.gameObject != m_DemoManager.Character)
            {
                return;
            }

            m_EnterExitCount++;
            m_DemoManager.EnteredTriggerZone(this, other.gameObject);
        }