メインコンテンツまでスキップ

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​
Declaration
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​
Declaration
public static IReadOnlyList<YauiSelectable> AllSelectables { get; }

Element​

The element of this GameObject.

View Source​
Declaration
public YauiElement Element { get; }

Interactable​

View Source​
Declaration
public bool Interactable { get; set; }

Transition​

View Source​
Declaration
public SelectableTransition Transition { get; set; }

TargetElement​

View Source​
Declaration
public YauiElement TargetElement { get; set; }

Colors​

View Source​
Declaration
public TransitionColors Colors { get; set; }

Sprites​

View Source​
Declaration
public TransitionSprites Sprites { get; set; }

Triggers​

View Source​
Declaration
public TransitionTriggers Triggers { get; set; }
View Source​
Declaration
public SelectableNavigation Navigation { get; set; }

IsInteractable​

Whether the selectable reacts: interactable, enabled and active.

View Source​
Declaration
public bool IsInteractable { get; }

CurrentState​

View Source​
Declaration
public SelectionState CurrentState { get; }

IsPressed​

Whether the pointer that is down went down on this selectable.

View Source​
Declaration
protected bool IsPressed { get; }

Methods​

OnEnable()​

View Source​
Declaration
protected virtual void OnEnable()

OnDisable()​

View Source​
Declaration
protected virtual void OnDisable()

OnValidate()​

View Source​
Declaration
protected virtual void OnValidate()

Select()​

Makes this the EventSystem's selected object.

View Source​
Declaration
public virtual void Select()

OnInteractableChanged()​

View Source​
Declaration
protected virtual void OnInteractableChanged()

FlashPressed()​

Shows the pressed state for a moment, for presses without a pointer (submit).

View Source​
Declaration
protected void FlashPressed()

OnPointerEnter(PointerEventData)​

View Source​
Declaration
public virtual void OnPointerEnter(PointerEventData eventData)
Parameters​
TypeName
PointerEventDataeventData

OnPointerExit(PointerEventData)​

View Source​
Declaration
public virtual void OnPointerExit(PointerEventData eventData)
Parameters​
TypeName
PointerEventDataeventData

OnPointerDown(PointerEventData)​

View Source​
Declaration
public virtual void OnPointerDown(PointerEventData eventData)
Parameters​
TypeName
PointerEventDataeventData

OnPointerUp(PointerEventData)​

View Source​
Declaration
public virtual void OnPointerUp(PointerEventData eventData)
Parameters​
TypeName
PointerEventDataeventData

OnSelect(BaseEventData)​

View Source​
Declaration
public virtual void OnSelect(BaseEventData eventData)
Parameters​
TypeName
BaseEventDataeventData

OnDeselect(BaseEventData)​

View Source​
Declaration
public virtual void OnDeselect(BaseEventData eventData)
Parameters​
TypeName
BaseEventDataeventData

OnMove(AxisEventData)​

View Source​
Declaration
public virtual void OnMove(AxisEventData eventData)
Parameters​
TypeName
AxisEventDataeventData

FindSelectableOnLeft()​

View Source​
Declaration
public virtual YauiSelectable FindSelectableOnLeft()
Returns​

Yaui.YauiSelectable

FindSelectableOnRight()​

View Source​
Declaration
public virtual YauiSelectable FindSelectableOnRight()
Returns​

Yaui.YauiSelectable

FindSelectableOnUp()​

View Source​
Declaration
public virtual YauiSelectable FindSelectableOnUp()
Returns​

Yaui.YauiSelectable

FindSelectableOnDown()​

View Source​
Declaration
public virtual YauiSelectable FindSelectableOnDown()
Returns​

Yaui.YauiSelectable

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​
Declaration
public YauiSelectable FindSelectable(Vector2 direction)
Returns​

Yaui.YauiSelectable

Parameters​
TypeName
Vector2direction

UpdateState(bool)​

Shows the current state. Instant skips the fade.

View Source​
Declaration
protected void UpdateState(bool instant)
Parameters​
TypeName
System.Booleaninstant

ApplyTransition(SelectionState, bool)​

View Source​
Declaration
protected virtual void ApplyTransition(SelectionState state, bool instant)
Parameters​
TypeName
Yaui.SelectionStatestate
System.Booleaninstant

Implements​

  • IPointerEnterHandler
  • IPointerExitHandler
  • IPointerDownHandler
  • IPointerUpHandler
  • ISelectHandler
  • IDeselectHandler
  • IMoveHandler