Пример #1
0
 public void UnRegisterPlayerChangeCallBack(string invokerName, PlayerControlMgr.PlayerChangeAction action = null)
 {
     if (this._changePlayerCallBacks.ContainsKey(invokerName))
     {
         if (action != null)
         {
             this._changePlayerCallBacks[invokerName].Remove(action);
         }
         else
         {
             this._changePlayerCallBacks.Remove(invokerName);
         }
     }
 }
Пример #2
0
 public void RegisterPlayerChangeCallBack(string invokerName, PlayerControlMgr.PlayerChangeAction action, PlayerControlMgr.PlayerChangeCondition condition = null)
 {
     if (this._changePlayerCallBacks.ContainsKey(invokerName))
     {
         if (!this._changePlayerCallBacks[invokerName].ContainsKey(action))
         {
             this._changePlayerCallBacks[invokerName].Add(action, condition);
         }
     }
     else
     {
         Dictionary <PlayerControlMgr.PlayerChangeAction, PlayerControlMgr.PlayerChangeCondition> dictionary = new Dictionary <PlayerControlMgr.PlayerChangeAction, PlayerControlMgr.PlayerChangeCondition>();
         dictionary.Add(action, condition);
         this._changePlayerCallBacks.Add(invokerName, dictionary);
     }
 }