/// <summary> /// An object has exited the trigger. /// </summary> /// <param name="other">The collider that exited the trigger.</param> private void OnTriggerExit(Collider other) { // A main character collider is required. if (!MathUtility.InLayerMask(other.gameObject.layer, 1 << LayerManager.Character)) { return; } if (other.gameObject.GetCachedParentComponent<UltimateCharacterLocomotion>() == null || other.gameObject.GetCachedParentComponent<LocalLookSource>() != null) { return; } m_DemoManager.ExitedTriggerZone(this); }
/// <summary> /// An object has exited the trigger. /// </summary> /// <param name="other">The collider that exited the trigger.</param> private void OnTriggerExit(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--; if (m_EnterExitCount == 0) { m_DemoManager.ExitedTriggerZone(this); } }