Class YauiSelectable
The base of controls: tracks the pointer and the EventSystem's selection, shows the state with a transition on a target element (like uGUI's Selectable), and moves the selection with the navigation events (gamepad, keyboard). Sits next to a Yaui.YauiElement; events on child elements bubble up to it.
Assembly: Yaui.dll
View Source
public abstract class YauiSelectable : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler, ISelectHandler, IDeselectHandler, IMoveHandler
Derived:
Yaui.YauiButton, Yaui.YauiDropdown, Yaui.YauiInputField, Yaui.YauiScrollbar, Yaui.YauiSlider, Yaui.YauiToggle
Implements:
IPointerEnterHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler, ISelectHandler, IDeselectHandler, IMoveHandler
Properties
AllSelectables
All enabled selectables.
View Source
public static IReadOnlyList<YauiSelectable> AllSelectables { get; }
Element
The element of this GameObject.
View Source
public YauiElement Element { get; }
Interactable
View Source
public bool Interactable { get; set; }
Transition
View Source
public SelectableTransition Transition { get; set; }
TargetElement
View Source
public YauiElement TargetElement { get; set; }
Colors
View Source
public TransitionColors Colors { get; set; }
Sprites
View Source
public TransitionSprites Sprites { get; set; }
Triggers
View Source
public TransitionTriggers Triggers { get; set; }
Navigation
View Source
public SelectableNavigation Navigation { get; set; }
IsInteractable
Whether the selectable reacts: interactable, enabled and active.
View Source
public bool IsInteractable { get; }
CurrentState
View Source
public SelectionState CurrentState { get; }
IsPressed
Whether the pointer that is down went down on this selectable.
View Source
protected bool IsPressed { get; }
Methods
OnEnable()
View Source
protected virtual void OnEnable()
OnDisable()
View Source
protected virtual void OnDisable()
OnValidate()
View Source
protected virtual void OnValidate()
Select()
Makes this the EventSystem's selected object.
View Source
public virtual void Select()
OnInteractableChanged()
View Source
protected virtual void OnInteractableChanged()
FlashPressed()
Shows the pressed state for a moment, for presses without a pointer (submit).
View Source
protected void FlashPressed()
OnPointerEnter(PointerEventData)
View Source
public virtual void OnPointerEnter(PointerEventData eventData)
Parameters
| Type | Name |
|---|---|
PointerEventData | eventData |
OnPointerExit(PointerEventData)
View Source
public virtual void OnPointerExit(PointerEventData eventData)
Parameters
| Type | Name |
|---|---|
PointerEventData | eventData |
OnPointerDown(PointerEventData)
View Source
public virtual void OnPointerDown(PointerEventData eventData)
Parameters
| Type | Name |
|---|---|
PointerEventData | eventData |
OnPointerUp(PointerEventData)
View Source
public virtual void OnPointerUp(PointerEventData eventData)
Parameters
| Type | Name |
|---|---|
PointerEventData | eventData |
OnSelect(BaseEventData)
View Source
public virtual void OnSelect(BaseEventData eventData)
Parameters
| Type | Name |
|---|---|
BaseEventData | eventData |
OnDeselect(BaseEventData)
View Source
public virtual void OnDeselect(BaseEventData eventData)
Parameters
| Type | Name |
|---|---|
BaseEventData | eventData |
OnMove(AxisEventData)
View Source
public virtual void OnMove(AxisEventData eventData)
Parameters
| Type | Name |
|---|---|
AxisEventData | eventData |
FindSelectableOnLeft()
View Source
public virtual YauiSelectable FindSelectableOnLeft()
Returns
FindSelectableOnRight()
View Source
public virtual YauiSelectable FindSelectableOnRight()
Returns
FindSelectableOnUp()
View Source
public virtual YauiSelectable FindSelectableOnUp()
Returns
FindSelectableOnDown()
View Source
public virtual YauiSelectable FindSelectableOnDown()
Returns
FindSelectable(Vector2)
The selectable of the same panel that is nearest in <code class="paramref">direction</code> (canvas space, Y down), weighted toward the direction like uGUI: the score is the distance along the direction over the squared distance.
View Source
public YauiSelectable FindSelectable(Vector2 direction)
Returns
Parameters
| Type | Name |
|---|---|
Vector2 | direction |
UpdateState(bool)
Shows the current state. Instant skips the fade.
View Source
protected void UpdateState(bool instant)
Parameters
| Type | Name |
|---|---|
System.Boolean | instant |
ApplyTransition(SelectionState, bool)
View Source
protected virtual void ApplyTransition(SelectionState state, bool instant)
Parameters
| Type | Name |
|---|---|
| Yaui.SelectionState | state |
System.Boolean | instant |
Implements
IPointerEnterHandlerIPointerExitHandlerIPointerDownHandlerIPointerUpHandlerISelectHandlerIDeselectHandlerIMoveHandler