Ejemplo n.º 1
0
        private void UpdateSlotArray()
        {
            GameObject aux             = EventSystemManager.GetCurrentSelection();
            GameObject finalSelectable = _slotArray.Get();

            if (_slotArray == null)
            {
                return;
            }

            if (aux != null && finalSelectable != aux)
            {
                currentSelectable = aux.GetComponent <Selectable>();

                if (_slotArray.IsEmpty() || aux != _slotArray.Get())
                {
                    OnNewFocus?.Invoke(aux);
                }

                _slotArray.Add(aux);
                finalSelectable = aux;
            }

            if (finalSelectable == null || !finalSelectable.activeSelf || (currentSelectable != null && !currentSelectable.interactable))
            {
                GameObject newObj = _slotArray.Remove();
                if (newObj)
                {
                    SetNewSelection(newObj, false);
                }
            }
        }
Ejemplo n.º 2
0
        private void DisableObject()
        {
            EventSystemManager.SetSelectionNull();

            foreach (Transform child in _buttonsContainer)
            {
                if (child == null)
                {
                    continue;
                }

                if (child.TryGetComponent <Button>(out Button button))
                {
                    button.onClick.RemoveListener(DisableObject);
                }
            }

            if (finishQustionEnum == FinishQustionEnum.Destroy)
            {
                GameObjectExtend.DestroyGameObject(gameObject);
            }
            else if (finishQustionEnum == FinishQustionEnum.Disactive)
            {
                gameObject.SetActive(false);
            }
        }
 private void DisableSelection()
 {
     if (selectable != null && selectable.gameObject == EventSystemManager.GetCurrentSelection())
     {
         EventSystemManager.SetSelectionNull();
     }
 }
Ejemplo n.º 4
0
        public static void SetNullWhenNotActive()
        {
            GameObject finalSelectable = _slotArray.Get();

            if (finalSelectable != null && !finalSelectable.activeSelf)
            {
                EventSystemManager.SetSelectionNull();
            }
        }
Ejemplo n.º 5
0
 public void LeaveFocus()
 {
     if (_isFocusPage)
     {
         EventSystemManager.SetSelectionNull();
     }
     _isFocusPage = false;
     gameObject.SetActive(false);
 }
Ejemplo n.º 6
0
        private void Down()
        {
            Selectable selectable = inputField.navigation.selectOnDown;

            if (selectable is PearlButton button)
            {
                button.WaitOnMove();
            }

            EventSystemManager.SetNewSelection(inputField.navigation.selectOnDown);
        }
Ejemplo n.º 7
0
 private static void SetNewSelection(GameObject obj, bool useTime = true)
 {
     if (useTime)
     {
         EventSystemManager.SetNewSelection(obj, _waitForInitFocus);
     }
     else
     {
         EventSystemManager.SetNewSelection(obj);
     }
 }
 protected void OnHighlight()
 {
     if (selectable && selectable.interactable)
     {
         stateButton = StateButtons.Highlighted;
         if (isFocusWhenHighlighted && selectable)
         {
             EventSystemManager.SetNewSelection(selectable.gameObject);
         }
         else
         {
             OnHighlighted?.Invoke();
         }
     }
 }
Ejemplo n.º 9
0
        public void Update()
        {
            if (_waitOnMove)
            {
                if (EventSystemManager.GetMovementState() == InputActionPhase.Waiting)
                {
                    _waitOnMove = false;
                }

                if (_timer.IsFinish())
                {
                    _waitOnMove = false;
                    AxisEventData eventData = new(EventSystem.current);
                    eventData.moveDir = _auxDirection;
                    OnMove(eventData);
                }
            }
        }
Ejemplo n.º 10
0
 public static void SetFocus(GameObject focus)
 {
     EventSystemManager.SetNewSelection(focus);
 }
Ejemplo n.º 11
0
 public static bool GetIstance(out EventSystemManager result)
 {
     return(Singleton <EventSystemManager> .GetIstance(out result));
 }
Ejemplo n.º 12
0
 private void Up()
 {
     EventSystemManager.SetNewSelection(inputField.navigation.selectOnUp);
 }
Ejemplo n.º 13
0
 public void SetFocus()
 {
     _isFocusPage = true;
     gameObject.SetActive(true);
     EventSystemManager.SetNewSelection(objectForFocus);
 }
Ejemplo n.º 14
0
 public static void PreserveCurrentFocus()
 {
     _focusSaved = EventSystemManager.GetCurrentSelection();
 }
Ejemplo n.º 15
0
 public static void RestoreFocusSaved()
 {
     EventSystemManager.SetNewSelection(_focusSaved);
 }
Ejemplo n.º 16
0
 private void NextText()
 {
     EventSystemManager.SetNewSelection(inputField.navigation.selectOnDown, 0.1f);
 }
Ejemplo n.º 17
0
 public static GameObject GetFocus()
 {
     return(EventSystemManager.GetCurrentSelection());
 }