Class ButtonFallbackComposite
A single Button value, such as the is tracked state, computed from an ordered list of bindings. Unity reads from the first binding that has a valid control.
Inheritance
Inherited Members
Namespace: UnityEngine .XR.Interaction.Toolkit.Inputs.Composites
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[InitializeOnLoad]
[Preserve]
public class ButtonFallbackComposite : FallbackComposite<float>
Remarks
This composite allows for defining multiple binding paths, but unlike a Value action with multiple bindings which uses control magnitude to select the active control, this composite uses an ordered priority list of bindings. If the first input binding is not bound to an input control, it falls back to try the second input binding, and so on.
Fields
first
The first input control to evaluate.
Declaration
[InputControl(layout = "Button")]
public int first
Field Value
Type | Description |
---|---|
int |
second
The second input control to evaluate.
Declaration
[InputControl(layout = "Button")]
public int second
Field Value
Type | Description |
---|---|
int |
third
The third input control to evaluate.
Declaration
[InputControl(layout = "Button")]
public int third
Field Value
Type | Description |
---|---|
int |
Methods
EvaluateMagnitude(ref InputBindingCompositeContext)
Declaration
public override float EvaluateMagnitude(ref InputBindingCompositeContext context)
Parameters
Type | Name | Description |
---|---|---|
Input |
context | Callback context for the binding composite. Unity uses this to access the values supplied by part bindings. |
Returns
Overrides
ReadValue(ref InputBindingCompositeContext)
Declaration
public override float ReadValue(ref InputBindingCompositeContext context)
Parameters
Type | Name | Description |
---|---|---|
Input |
context | Callback context for the binding composite. Unity uses this to access the values supplied by part bindings. |