コード例 #1
0
    public static void RemoveListener(enECType _ecType, Action <object> _callBack)
    {
        uint key = (uint)_ecType;

        if (!HasPDictDefined(key))
        {
            return;
        }
        List <Action <object> > listHandlers = mParamDict[key];

        for (int i = 0; i < listHandlers.Count; i++)
        {
            if (listHandlers[i] == _callBack)
            {
                listHandlers.RemoveAt(i);
                break;
            }
        }
    }
コード例 #2
0
    public static void Dispatch(enECType _ecType, object param = null)
    {
        uint key = (uint)_ecType;

        if (param == null && HasDictDefined(key))
        {
            List <Action> listHandlers = mDict[key];
            for (int i = 0; i < listHandlers.Count; i++)
            {
                listHandlers[i]();
            }
        }
        else if (HasPDictDefined(key))
        {
            List <Action <object> > listHandlers = mParamDict[key];
            for (int i = 0; i < listHandlers.Count; i++)
            {
                listHandlers[i](param);
            }
        }
    }
コード例 #3
0
 static bool IsDontDestroy(enECType _type)
 {
     return(_type < enECType.MSG_MODULE);
 }