Class DpadComposite
A 2D planar motion vector computed from an up+down button pair and a left+right button pair.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: UnityEngine.Experimental.Input.Composites
Syntax
public class DpadComposite : InputBindingComposite<Vector2>, IInputBindingComposite<Vector2>, IInputBindingComposite
Remarks
This composite allows to grab arbitrary buttons from a device and arrange them in a D-Pad like configuration. Based on button presses, the composite will return a normalized direction vector.
Opposing motions cancel each other out. Meaning that if, for example, both the left and right horizontal button are pressed, the resulting horizontal movement value will be zero.
Fields
down
Declaration
public int down
Field Value
Type | Description |
---|---|
System.Int32 |
left
Declaration
public int left
Field Value
Type | Description |
---|---|
System.Int32 |
normalize
If true (default), then the resulting vector will be normalized. Otherwise, diagonal vectors will have a magnitude > 1.
Declaration
public bool normalize
Field Value
Type | Description |
---|---|
System.Boolean |
right
Declaration
public int right
Field Value
Type | Description |
---|---|
System.Int32 |
up
Declaration
public int up
Field Value
Type | Description |
---|---|
System.Int32 |
Methods
ReadValue(ref InputBindingCompositeContext)
Declaration
public override Vector2 ReadValue(ref InputBindingCompositeContext context)
Parameters
Type | Name | Description |
---|---|---|
InputBindingCompositeContext | context |
Returns
Type | Description |
---|---|
Vector2 |
Overrides
UnityEngine.Experimental.Input.InputBindingComposite<Vector2>.ReadValue(UnityEngine.Experimental.Input.InputBindingCompositeContext)