コード例 #1
0
ファイル: EventSubscriber.cs プロジェクト: lingfan/lxl_cpp
 public EventId <EventKeyType> Subscribe <T>(EventKeyType eventKey, System.Action <EventKeyType, T> cb)
 {
     if (m_mgr.IsAlive)
     {
         EventMgr <EventKeyType> mgr = m_mgr.Target as EventMgr <EventKeyType>;
         EventId <EventKeyType>  ret = mgr.Subscribe(eventKey, cb);
         if (ret.IsValid())
         {
             m_eventIdSet.Add(ret);
         }
         return(ret);
     }
     return(new EventId <EventKeyType>());
 }