private void DisableSelection()
 {
     if (selectable != null && selectable.gameObject == EventSystemManager.GetCurrentSelection())
     {
         EventSystemManager.SetSelectionNull();
     }
 }
예제 #2
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);
                }
            }
        }
예제 #3
0
 public static GameObject GetFocus()
 {
     return(EventSystemManager.GetCurrentSelection());
 }
예제 #4
0
 public static void PreserveCurrentFocus()
 {
     _focusSaved = EventSystemManager.GetCurrentSelection();
 }