public static void Select(IInteractableComponent button) { if (button != null) { var sel = button.GetSelectable(); if (sel != null) { if (button.IsVisible() == false) { var buttonBase = (button as WindowComponentBase); System.Action callback = null; callback = () => { WindowSystem.GetEvents().Unregister(buttonBase, WindowEventType.OnShowEnd, callback); WindowSystemInput.Select_INTERNAL(button); }; WindowSystem.GetEvents().Register(buttonBase, WindowEventType.OnShowEnd, callback); } else { WindowSystemInput.Select_INTERNAL(button); } } } }
public static void Select(IInteractableComponent button) { if (button != null) { var sel = button.GetSelectable(); if (sel != null) sel.Select(); } }
public static void Deselect(IInteractableComponent button) { if (button != null) { var sel = button.GetSelectable(); if (sel != null) { sel.OnDeselect(null); } } }
public static void Deselect(IInteractableComponent button) { if (button != null) { var sel = button.GetSelectable(); if (sel != null) { if (EventSystem.current.currentSelectedGameObject == sel.gameObject) { EventSystem.current.SetSelectedGameObject(null); } } } }
private static void Select_INTERNAL(IInteractableComponent button) { var sel = button.GetSelectable(); if (sel != null) { WindowSystemInput.Deselect(button); sel.Select(); if (sel is ButtonExtended) { (sel as ButtonExtended).Select(forced: true); } } }