// Update is called once per frame protected virtual void Update() { if (UIHiveBrain.IsActiveUI(this)) { ActiveUIUpdate(); } }
void SaveSelected() { if (UIHiveBrain.IsActiveUI(Larva)) { LastSelected = EventSystem.current.currentSelectedGameObject; } }
private bool CanClose() { if (Target.isActiveAndEnabled == false) { return(false); } if (RequireFocusToClose && !UIHiveBrain.IsActiveUI(Target)) { return(false); } return(true); }
private void Awake() { Larva = GetComponent <UIHiveLarva>(); if (Larva != null) { Larva.OnUIFocus += SelectUIElement; Larva.OnUIUnfocus += SaveSelected; } if (UIHiveBrain.IsActiveUI(Larva)) { SelectUIElement(); } }
protected virtual void OnDisable() { OnUIUnfocus?.Invoke(); UIHiveBrain.RemoveClosingUI(this); }
protected virtual void OnEnable() { UIHiveBrain.AddOpeningUI(this); OnUIFocus?.Invoke(); }