docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ScaleVector2Processor

    Scale the components of a Vector2 by constant factors.

    Inheritance
    object
    InputProcessor
    InputProcessor<Vector2>
    ScaleVector2Processor
    Inherited Members
    InputProcessor<Vector2>.ProcessAsObject(object, InputControl)
    InputProcessor<Vector2>.Process(void*, int, InputControl)
    InputProcessor.cachingPolicy
    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
    ScaleProcessor
    ScaleVector3Processor

    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
    ScaleProcessor
    ScaleVector3Processor

    Methods

    Process(Vector2, InputControl)

    Return value scaled by x and y.

    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
    InputProcessor<Vector2>.Process(Vector2, InputControl)
    See Also
    ScaleProcessor
    ScaleVector3Processor

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()
    See Also
    ScaleProcessor
    ScaleVector3Processor

    See Also

    ScaleProcessor
    ScaleVector3Processor
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)