Пример #1
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());
            }
        }
    }
Пример #2
0
    public void AddBehaviorsTransRule(UNBehaviorType fromType, UNBehaviorType toType)
    {
        UNList <UNBehaviorType> fromList = null;

        if (m_behaviorsTransRules.ContainsKey(toType))
        {
            if (!m_behaviorsTransRules[toType].Contains(fromType))
            {
                fromList = m_behaviorsTransRules[toType];
            }
        }
        else
        {
            fromList = UNList <UNBehaviorType> .New();
        }
        if (fromList != null)
        {
            fromList.Add(fromType);
        }
        AddBehaviorsTransRule(fromList, toType);
    }