public void AddWaitBehavior(UNBehaviorType bType, int priority = 0, UNBehaviorStateType bState = UNBehaviorStateType.Wait, UNBehaviorChangeStateCallBack cbBeforeChange = null, UNBehaviorChangeStateCallBack cbAfterChange = null) { m_cbsBeforeBehaviorChange.Add(cbBeforeChange); m_cbsAfterBehaviorChange.Add(cbAfterChange); AddWaitBehavior(UNBehavior.New(bType, priority, bState, m_cbsBeforeBehaviorChange, m_cbsAfterBehaviorChange)); }
public void AddBehaviorImmediate(UNBehaviorType bType, int priority = 0, UNBehaviorStateType bState = UNBehaviorStateType.Wait, UNBehaviorChangeStateCallBack cbBeforeChange = null, UNBehaviorChangeStateCallBack cbAfterChange = null) { m_cbsBeforeBehaviorChange.Add(cbBeforeChange); m_cbsAfterBehaviorChange.Add(cbAfterChange); if (m_curBehavior.IsNull()) { m_curBehavior = UNBehavior.New(); m_curBehavior.ResetToBehavior(bType, priority, bState, m_cbsBeforeBehaviorChange, m_cbsAfterBehaviorChange); } else { m_curBehavior.ChangeToState(UNBehaviorStateType.Finish); m_curBehavior.ResetToBehavior(bType, priority, bState, m_cbsBeforeBehaviorChange, m_cbsAfterBehaviorChange); } m_curBehavior.ChangeToState(UNBehaviorStateType.Execute); }