Esempio n. 1
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 /// <param name="callback"></param>
 /// <param name="isTriggerCacheData"></param>
 static public void AddListener(this ADataListener dl,
                                Enum name,
                                Action <object> callback = null,
                                int order               = -1,
                                int triggernum          = -1,
                                bool isTriggerCacheData = false)
 {
     dl.AddListener(name.ToString(), callback, order, triggernum, isTriggerCacheData);
 }
Esempio n. 2
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="dl"></param>
 /// <param name="name">监听数据名</param>
 /// <param name="action">回调</param>
 /// <param name="order">顺序</param>
 /// <param name="triggerNum">触发次数,-1代表一直触发</param>
 /// <param name="isTriggerCacheData">是否触发回调</param>
 /// <typeparam name="T"></typeparam>
 static public void AddListener <T>(this ADataListener dl, Enum name, Action <T> action = null,
                                    int order      = -1,
                                    int triggerNum = -1, bool isTriggerCacheData = false)  where T : class
 {
     dl.AddListener <T>(name.ToString(), action, order, triggerNum, isTriggerCacheData);
 }
Esempio n. 3
0
 /// <summary>
 /// T版本添加监听
 /// </summary>
 /// <param name="dl"></param>
 /// <param name="name">监听数据名</param>
 /// <param name="action">回调</param>
 /// <param name="order">顺序</param>
 /// <param name="triggerNum">触发次数,-1代表一直触发</param>
 /// <param name="isTriggerCacheData">是否触发回调</param>
 /// <typeparam name="T"></typeparam>
 static public void AddListener <T>(this ADataListener dl, Action <T> action = null, int order = -1, int triggerNum = -1, bool isTriggerCacheData = false) where T : class, new()
 {
     dl.AddListener <T>(typeof(T).FullName, action, order, triggerNum, isTriggerCacheData);
 }
 /// <summary>
 /// T版本监听一次
 /// </summary>
 /// <param name="name"></param>
 /// <param name="callback"></param>
 /// <param name="isTriggerCacheData"></param>
 static public void AddListenerOnce <T>(this ADataListener dl, Action <T> callback = null, int order = -1, bool isTriggerCacheData = false) where T : class, new()
 {
     dl.AddListener <T>(typeof(T).FullName, callback, order, 1, isTriggerCacheData);
 }