Struct Toggle
Component for toggle buttons.
Namespace: Unity.Tiny.UIControls
Syntax
public struct Toggle : IComponentData
Fields
isOn
True if the toggle is on (for example, checked).
Declaration
public bool isOn
Field Value
Type | Description |
---|---|
System.Boolean |
sprite2DRenderer
Reference to an entity with a Sprite2DRenderer component that represents the button's toggle's state. Mouse/touch interaction, captured by the PointerInteraction component, swaps or modifies the sprite based on the type of transitions you apply. If this is set to NONE, it assumes that the underlying entity (the one that the Toggle component is attached to) also has a Sprite2DRenderer component, and uses that.
Declaration
public Entity sprite2DRenderer
Field Value
Type | Description |
---|---|
Entity |
transition
Reference to an entity that defines visual transitions based on mouse/ touch interaction captured by the PointerInteraction component. For example, A SpriteTransition or ColorTintTransition component. Used when isOn is true.
Declaration
public Entity transition
Field Value
Type | Description |
---|---|
Entity |
transitionChecked
Reference to an entity that defines visual transitions based on mouse/ touch interaction captured by the PointerInteraction component. For example, A SpriteTransition or ColorTintTransition component. Used when isOn is false.
Declaration
public Entity transitionChecked
Field Value
Type | Description |
---|---|
Entity |