Class Vector2Control
A floating-point 2D vector control composed of two AxisControl.
Inherited Members
Namespace: UnityEngine.InputSystem.Controls
Syntax
public class Vector2Control : InputControl<Vector2>
Remarks
Normalization is not implied. The X and Y coordinates can be in any range or units.
Examples
An example is position.
Debug.Log(string.Format("Mouse position x={0} y={1}",
InputSystem.GetDevice<Mouse>().position.x.value,
Inputsystem.GetDevice<Mouse>().position.y.value));
Constructors
Vector2Control()
Declaration
public Vector2Control()
Properties
x
Horizontal position of the control.
Declaration
public AxisControl x { get; }
Property Value
Type | Description |
---|---|
AxisControl |
y
Vertical position of the control.
Declaration
public AxisControl y { get; }
Property Value
Type | Description |
---|---|
AxisControl |
Methods
EvaluateMagnitude(Void*)
Declaration
public override float EvaluateMagnitude(void *statePtr)
Parameters
Type | Name | Description |
---|---|---|
System.Void* | statePtr |
Returns
Type | Description |
---|---|
System.Single |
Overrides
FinishSetup()
Declaration
protected override void FinishSetup()
Overrides
ReadUnprocessedValueFromState(Void*)
Declaration
public override Vector2 ReadUnprocessedValueFromState(void *statePtr)
Parameters
Type | Name | Description |
---|---|---|
System.Void* | statePtr |
Returns
Type | Description |
---|---|
Vector2 |
Overrides
UnityEngine.InputSystem.InputControl<Vector2>.ReadUnprocessedValueFromState(System.Void*)
WriteValueIntoState(Vector2, Void*)
Declaration
public override void WriteValueIntoState(Vector2 value, void *statePtr)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | value | |
System.Void* | statePtr |
Overrides
UnityEngine.InputSystem.InputControl<Vector2>.WriteValueIntoState(Vector2, System.Void*)