Class ScaleVector2Processor
Scale the components of a Vector2 by constant factors.
Inherited Members
Namespace: UnityEngine.InputSystem.Processors
Assembly: Unity.InputSystem.dll
Syntax
public class ScaleVector2Processor : InputProcessor<Vector2>
Remarks
This processor is registered (see RegisterProcessor<T>(string)) under the name "scaleVector2".
// Double the length of the vector produced by leftStick on gamepad.
myAction.AddBinding("<Gamepad>/leftStick").WithProcessor("scaleVector2(x=2,y=2)");
Fields
x
Scale factor to apply to the vector's x
axis. Defaults to 1.
Declaration
[Tooltip("Scale factor to multiply the incoming Vector2's X component by.")]
public float x
Field Value
Type | Description |
---|---|
float |
See Also
y
Scale factor to apply to the vector's y
axis. Defaults to 1.
Declaration
[Tooltip("Scale factor to multiply the incoming Vector2's Y component by.")]
public float y
Field Value
Type | Description |
---|---|
float |
See Also
Methods
Process(Vector2, InputControl)
Declaration
public override Vector2 Process(Vector2 value, InputControl control)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | value | Input value. |
InputControl | control | Ignored. |
Returns
Type | Description |
---|---|
Vector2 | Scaled vector. |
Overrides
See Also
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |