예제 #1
0
 // Update is called once per frame
 protected virtual void Update()
 {
     if (UIHiveBrain.IsActiveUI(this))
     {
         ActiveUIUpdate();
     }
 }
예제 #2
0
 void SaveSelected()
 {
     if (UIHiveBrain.IsActiveUI(Larva))
     {
         LastSelected = EventSystem.current.currentSelectedGameObject;
     }
 }
예제 #3
0
 private bool CanClose()
 {
     if (Target.isActiveAndEnabled == false)
     {
         return(false);
     }
     if (RequireFocusToClose && !UIHiveBrain.IsActiveUI(Target))
     {
         return(false);
     }
     return(true);
 }
예제 #4
0
    private void Awake()
    {
        Larva = GetComponent <UIHiveLarva>();

        if (Larva != null)
        {
            Larva.OnUIFocus   += SelectUIElement;
            Larva.OnUIUnfocus += SaveSelected;
        }

        if (UIHiveBrain.IsActiveUI(Larva))
        {
            SelectUIElement();
        }
    }
예제 #5
0
 protected virtual void OnDisable()
 {
     OnUIUnfocus?.Invoke();
     UIHiveBrain.RemoveClosingUI(this);
 }
예제 #6
0
 protected virtual void OnEnable()
 {
     UIHiveBrain.AddOpeningUI(this);
     OnUIFocus?.Invoke();
 }