Beispiel #1
0
        public void UnregisterObserver(uint uiGameEventId, IGameEventObserver Observer)
        {
            IGameEventSubject sub_ = GetSubject(uiGameEventId);

            if (sub_ != null)
            {
                sub_.Detach(Observer);
            }
        }
Beispiel #2
0
 private IGameEventSubject GetSubject(uint uiGameEventId)
 {
     if (m_GameEvents.ContainsKey(uiGameEventId))
     {
         return(m_GameEvents[uiGameEventId]);
     }
     else
     {
         IGameEventSubject sub_ = m_GameEventBase.NeedSubject(uiGameEventId);
         if (sub_ == null)
         {
             Debugger.LogError("[GameEventSystem] No subject id = " + uiGameEventId);
             return(null);
         }
         else
         {
             AddGameEventSubject(uiGameEventId, sub_);
             return(sub_);
         }
     }
 }
Beispiel #3
0
 private void AddGameEventSubject(uint uiGameEventId, IGameEventSubject Subject)
 {
     m_GameEvents.Add(uiGameEventId, Subject);
 }