public void RegisterEvent(GUIEventID eventId, Action <object> callback) { if (!allCallbacks.ContainsKey(eventId)) { allCallbacks.Add(eventId, null); } allCallbacks[eventId] += callback; }
private void Transition(GUIEventID _id) { var index = ActiveState[_id]; if (index != -1) { this.activeIndex = index; this.ActiveState.Enter(); } }
public void NotifyEvent(GUIEventID eventId, object param = null) { if (allCallbacks.ContainsKey(eventId)) { var callback = allCallbacks[eventId]; if (callback != null) { callback(param); } } }
internal int this[GUIEventID id] { get { int _event; if (this.transitions.TryGetValue(id, out _event)) { return(_event); } return(-1); } }
public void RemoveEvent(GUIEventID eventId, Action <object> callback) { if (allCallbacks.ContainsKey(eventId)) { allCallbacks[eventId] -= callback; if (allCallbacks[eventId] == null) { allCallbacks.Remove(eventId); } } }
public void AddTransition(GUIEventID id, int _event) { this.transitions.Add(id, _event); }