/// <summary> /// Initializes a new instance of the <see cref="KS.PizzaEmpire.Unity.GUIEvent"/> struct. /// </summary> /// <param name="el">The element enum to associate with this event</param> /// <param name="ge">The event enum that this event represents</param> public GUIEvent(GUIElementEnum el, GUIEventEnum ge) { this.Element = el; this.GEvent = ge; }
/// <summary> /// Returns the child with the specified element enum /// </summary> /// <param name="element"></param> public GUIItem GetChild(GUIElementEnum element) { if (Children.ContainsKey(element)) { return Children[element]; } return null; }
/// <summary> /// Returns the child with the specified element enum looking recursively /// through child items /// </summary> /// <param name="element"></param> public GUIItem GetChildNested(GUIElementEnum element) { if (Children.ContainsKey(element)) { return Children[element]; } foreach (GUIItem child in Children.Values) { GUIItem found = child.GetChildNested(element); if (found != null) { return found; } } return null; }
/// <summary> /// Removes a child from the item /// </summary> public void RemoveChild(GUIElementEnum element) { if (IsDrawing) { toRemove.Add(element); } else { if (Children.ContainsKey(element)) { Children.Remove(element); ChildrenModified = true; } } }