private void InitStateCbs() { if (m_stateCbs.IsNull()) { m_stateCbs = UNDictionary <UNBehaviorStateType, UNBehaviorChangeToState> .New(); } m_stateCbs.Add(UNBehaviorStateType.Wait, Wait); m_stateCbs.Add(UNBehaviorStateType.Execute, Execute); m_stateCbs.Add(UNBehaviorStateType.Finish, Finish); }
public void CopyTo(ref UNDictionary <TKey, TValue> toDict) { if (toDict.IsNull()) { toDict = new UNDictionary <TKey, TValue>(); } toDict.Clear(); for (int i = 0; i < m_keys.Count; ++i) { toDict.Add(m_keys[i], m_dict[m_keys[i]]); } }
// 初始化行为转换规则 public void InitBehaviorsTrans() { var tableData = TableManager.Instance.GetEntry <ResBehaviorList>(m_ID) as ResBehavior; if (tableData.IsNull()) { UNDebug.LogError("no this behavior " + m_ID); return; } if (m_behaviorsTransRules.IsNull()) { m_behaviorsTransRules = UNDictionary <UNBehaviorType, UNList <UNBehaviorType> > .New(); } for (int i = 0; i < tableData.trans.Count; ++i) { var data = tableData.trans[i]; var fromType = (UNBehaviorType)data.from; var toType = (UNBehaviorType)data.to; AddBehaviorsTransRule(fromType, toType); } }