public static void NotifyListeners(UIContext uiContext) { foreach (var listener in globalListeners) { uiContext.CheckListener(listener); } NotifyListenersAndChildren(uiContext, focusedObject); }
private static void NotifyListenersAndChildren(UIContext uiContext, ZComponent obj) { if (obj != null) { foreach (var listener in obj.listeners.ToList()) { uiContext.CheckListener(listener); } } if (obj is ZGameObject) { foreach (var child in ((ZGameObject)obj).children) { NotifyListenersAndChildren(uiContext, child); } } }