public void ChangeState_Instantly(hwmFSMState newState) { ChangeStart(newState); if (m_ChangeFromState != null) { hwmDebug.Assert(m_ChangeFromState.SupportInstantlyChange(), "ChangeFromState not support instantly change", gameObject); m_ChangeFromState.Deactivate_Instantly(); } m_CurrentState = null; if (m_ChangeToState != null) { hwmDebug.Assert(m_ChangeFromState.SupportInstantlyChange(), "m_ChangeToState not support instantly change", gameObject); m_ChangeToState.Activate_Instantly(); } ChangeFinished(); }
protected virtual void Awake() { m_States = GetComponentsInChildren <hwmFSMState>(true); for (int iState = 0; iState < m_States.Length; iState++) { hwmFSMState iterState = m_States[iState]; hwmDebug.Assert(iterState.SupportInstantlyChange() || iterState.SupportCoroutineChange() , string.Format("State ({0}) not support change", iterState.StateName) , gameObject); iterState.Initialize(this); } }