private void TryStartMotion(MotionState motion) { if (!motion.IsActive && motion.CanStart()) { if (!string.IsNullOrEmpty(motion.GetDestinationState())) { for (int j = 0; j < this.m_Motions.Count; j++) { if (this.m_Motions [j].IsActive && this.m_Motions [j].Layer == motion.Layer && !string.IsNullOrEmpty(this.m_Motions [j].GetDestinationState())) { if (j > motion.Index) { this.m_Motions [j].StopMotion(true); } else { return; } } } } DeterminanteDefaultStates(); motion.StartMotion(); } }
private void TryStartMotion(MotionState motion) { if (!motion.IsActive && motion.CanStart() && this.m_Animator.GetCurrentAnimatorStateInfo(1).IsTag("Interruptable")) { if (!string.IsNullOrEmpty(motion.GetDestinationState())) { for (int j = 0; j < this.m_Motions.Count; j++) { if (this.m_Motions [j].IsActive && this.m_Motions [j].Layer == motion.Layer && !string.IsNullOrEmpty(this.m_Motions [j].GetDestinationState())) { if (j > motion.Index) { this.m_Motions [j].StopMotion(true); } else { return; } } } } if (!string.IsNullOrEmpty(motion.State)) { DeterminanteDefaultStates(); } motion.StartMotion(); } }