public static bool IsActiveUI(UIHiveLarva ui) { if (openUIs.Count == 0) { return(false); } return(ActiveUI == ui); }
private static void DoNewFocusEvent() { if (ActiveUI == previousFocus) { return; } OnUIListChanged?.Invoke(ActiveUI); previousFocus = ActiveUI; }
private void Awake() { Larva = GetComponent <UIHiveLarva>(); if (Larva != null) { Larva.OnUIFocus += SelectUIElement; Larva.OnUIUnfocus += SaveSelected; } if (UIHiveBrain.IsActiveUI(Larva)) { SelectUIElement(); } }
public static void RemoveClosingUI(UIHiveLarva ui) { // remove furthest back instance of this from the list int remI = -1; for (int i = openUIs.Count - 1; i >= 0; --i) { if (openUIs[i] == ui) { remI = i; break; } } if (remI != -1) { openUIs.RemoveAt(remI); } DoNewFocusEvent(); }
protected virtual void OnFocusChange(UIHiveLarva newFocus) { }
public static void AddOpeningUI(UIHiveLarva ui) { // add ui to end of open list openUIs.Add(ui); DoNewFocusEvent(); }