Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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]]);
     }
 }
Ejemplo n.º 3
0
    // 初始化行为转换规则
    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);
        }
    }