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); } } }
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(); } }
public static void SetNullWhenNotActive() { GameObject finalSelectable = _slotArray.Get(); if (finalSelectable != null && !finalSelectable.activeSelf) { EventSystemManager.SetSelectionNull(); } }
public void LeaveFocus() { if (_isFocusPage) { EventSystemManager.SetSelectionNull(); } _isFocusPage = false; gameObject.SetActive(false); }
private void Down() { Selectable selectable = inputField.navigation.selectOnDown; if (selectable is PearlButton button) { button.WaitOnMove(); } EventSystemManager.SetNewSelection(inputField.navigation.selectOnDown); }
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(); } } }
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); } } }
public static void SetFocus(GameObject focus) { EventSystemManager.SetNewSelection(focus); }
public static bool GetIstance(out EventSystemManager result) { return(Singleton <EventSystemManager> .GetIstance(out result)); }
private void Up() { EventSystemManager.SetNewSelection(inputField.navigation.selectOnUp); }
public void SetFocus() { _isFocusPage = true; gameObject.SetActive(true); EventSystemManager.SetNewSelection(objectForFocus); }
public static void PreserveCurrentFocus() { _focusSaved = EventSystemManager.GetCurrentSelection(); }
public static void RestoreFocusSaved() { EventSystemManager.SetNewSelection(_focusSaved); }
private void NextText() { EventSystemManager.SetNewSelection(inputField.navigation.selectOnDown, 0.1f); }
public static GameObject GetFocus() { return(EventSystemManager.GetCurrentSelection()); }