Exemple #1
0
    public TKey GetKey(int index)
    {
        TKey key = default(TKey);

        if (m_keys.Count > index)
        {
            key = m_keys[index];
        }
        else
        {
            UNDebug.LogError(UNString.LinkString("EZFunDictionary index ", index.ToString(), "error"));
        }
        return(key);
    }
Exemple #2
0
    public void DispatchEventImmediate(EventType type, object[] pars)
    {
        if (!m_listeners.ContainsKey(type))
        {
            return;
        }
        var cbs = m_listeners[type];

        for (int i = 0; i < cbs.Count; ++i)
        {
            try
            {
                cbs[i](pars);
            }
            catch (System.Exception ex)
            {
                UNDebug.LogError(ex.ToString());
            }
        }
    }
Exemple #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);
        }
    }