public void SendEvent(TEPath path, TireEventType type, System.Object param) { Tire.SendEvent(type, param); if (path == TEPath.Local) { } else if(path == TEPath.Up) { Parent.SendEvent(path, type, param); } else if(path == TEPath.Down) { foreach(var child in Children) { child.SendEvent(path, type, param); } } else if(path == TEPath.UpDown) { Parent.SendEvent(TEPath.Up, type, param); foreach (var child in Children) { child.SendEvent(TEPath.Down, type, param); } } }
public void RemoveEventListener(TireEventType type, Action<object> handler) { var handlersList = HandlersMap[type]; if (handlersList == null) { handlersList.Remove(handler); } }
public void AddEventListener(TireEventType type, Action<object> handler) { var handlersList = HandlersMap[type]; if(handlersList == null) { handlersList = new HashSet<Action<System.Object>>(); HandlersMap[type] = handlersList; } handlersList.Add(handler); }
public void SendEvent(TireEventType type, Object param) { var handlersList = HandlersMap[type]; if (handlersList == null) { foreach (var handler in handlersList) { handler(param); } } }
public void RemoveEventListener(TireEventType type, Action<System.Object> handler) { Tire.RemoveEventListener(type, handler); }