void OnTriggerExit(Collider other) { if (RCM != null) { if (RCM == other.GetComponent <RiderControllerMounted>()) { RCM = other.GetComponent <RiderControllerMounted>(); if (RCM.Can_Mount) { RCM.Can_Mount = false; } RCM.findHorse(null); RCM = null; } } if (RFPS != null) { if (RFPS == other.GetComponent <Rider>()) { RFPS = other.GetComponent <Rider>(); if (RFPS.Can_Mount) { RFPS.Can_Mount = false; } RFPS.findHorse(null); RFPS = null; } } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (stateInfo.IsTag("Mounting")) { if (animator.transform.GetComponent <RiderControllerMounted>()) { RiderControllerMounted rider = animator.transform.GetComponent <RiderControllerMounted>(); rider.EnableMounting(); } } if (stateInfo.IsTag("Mounting")) { if (animator.transform.GetComponent <Rider>()) { Rider rider = animator.transform.GetComponent <Rider>(); rider.EnableMounting(); } } }
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (stateInfo.IsTag("Unmounting")) { if (animator.transform.GetComponent <RiderControllerMounted>()) { RiderControllerMounted rider = animator.transform.GetComponent <RiderControllerMounted>(); rider.IsInHorse = false; rider.DisableMounting(); } } if (stateInfo.IsTag("Unmounting")) { if (animator.transform.GetComponent <Rider>()) { Rider rider = animator.transform.GetComponent <Rider>(); rider.DisableMounting(lastpos); } } }
void OnTriggerEnter(Collider other) { if (!HorseC.Mounted) { if (other.GetComponent <RiderControllerMounted>()) //Old Script { RCM = other.GetComponent <RiderControllerMounted>(); RCM.Can_Mount = true; RCM.findHorse(HorseC); if (LeftSide) { RCM.Mountedside = true; } else { RCM.Mountedside = false; } } if (other.GetComponent <Rider>()) { RFPS = other.GetComponent <Rider>(); RFPS.Can_Mount = true; RFPS.findHorse(HorseC); if (LeftSide) { RFPS.Mountedside = true; } else { RFPS.Mountedside = false; } } } }