예제 #1
0
    public void RegisterEvent(GUIEventID eventId, Action <object> callback)
    {
        if (!allCallbacks.ContainsKey(eventId))
        {
            allCallbacks.Add(eventId, null);
        }

        allCallbacks[eventId] += callback;
    }
예제 #2
0
        private void Transition(GUIEventID _id)
        {
            var index = ActiveState[_id];

            if (index != -1)
            {
                this.activeIndex = index;
                this.ActiveState.Enter();
            }
        }
예제 #3
0
 public void NotifyEvent(GUIEventID eventId, object param = null)
 {
     if (allCallbacks.ContainsKey(eventId))
     {
         var callback = allCallbacks[eventId];
         if (callback != null)
         {
             callback(param);
         }
     }
 }
예제 #4
0
 internal int this[GUIEventID id]
 {
     get
     {
         int _event;
         if (this.transitions.TryGetValue(id, out _event))
         {
             return(_event);
         }
         return(-1);
     }
 }
예제 #5
0
    public void RemoveEvent(GUIEventID eventId, Action <object> callback)
    {
        if (allCallbacks.ContainsKey(eventId))
        {
            allCallbacks[eventId] -= callback;

            if (allCallbacks[eventId] == null)
            {
                allCallbacks.Remove(eventId);
            }
        }
    }
예제 #6
0
 public void AddTransition(GUIEventID id, int _event)
 {
     this.transitions.Add(id, _event);
 }