コード例 #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();
 }