Class ScaleProcessor
Scale a float value by a constant factor.
Inherited Members
Namespace: UnityEngine.InputSystem.Processors
Assembly: Unity.InputSystem.dll
Syntax
public class ScaleProcessor : InputProcessor<float>
Remarks
This processor is registered (see RegisterProcessor<T>(string)) under the name "scale".
// Bind to left trigger on the gamepad such that its values are scaled by a factor of 2.
new InputAction(binding: "<Gamepad>/leftTrigger", processors: "scale(factor=2)");
Fields
factor
Scale factor to apply to incoming input values. Defaults to 1 (no scaling).
Declaration
[Tooltip("Scale factor to multiply incoming float values by.")]
public float factor
Field Value
Type | Description |
---|---|
float |
See Also
Methods
Process(float, InputControl)
Scale the given value
by factor.
Declaration
public override float Process(float value, InputControl control)
Parameters
Type | Name | Description |
---|---|---|
float | value | Input value. |
InputControl | control | Ignored. |
Returns
Type | Description |
---|---|
float | Scaled value. |
Overrides
See Also
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |