/// <summary> /// Checks if the character has leave the boundings. /// </summary> /// <param name="c">The collider to be tested.</param> private void OnTriggerExit(Collider c) { FirstPersonCharacterController FPController = c.GetComponent <FirstPersonCharacterController>(); if (FPController != null) { FPController.ClimbingLadder(false, Vector3.zero, m_SurfaceIdentifier); } }
/// <summary> /// Checks if the character is within the boundings of the ladder. /// </summary> /// <param name="c">The collider to be tested.</param> private void OnTriggerStay(Collider c) { FirstPersonCharacterController FPController = c.GetComponent <FirstPersonCharacterController>(); Bounds ladderBounds = GetComponent <Collider>().bounds; if (FPController != null) { FPController.ClimbingLadder(true, ladderBounds.max, m_SurfaceIdentifier); } }