Class ScaleVector2Processor | Input System | 1.0.2
docs.unity3d.com
    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*, Int32, InputControl)
    Namespace: UnityEngine.InputSystem.Processors
    Syntax
    [Preserve]
    public class ScaleVector2Processor : InputProcessor<Vector2>
    Remarks
    // Double the length of the vector produced by leftStick on gamepad.
    myAction.AddBinding("<Gamepad>/leftStick").WithProcessor("scaleVector2(x=2,y=2)");

    Fields

    x

    Declaration
    [Tooltip("Scale factor to multiple the incoming Vector2's X component by.")]
    public float x
    Field Value
    Type Description
    Single

    y

    Declaration
    [Tooltip("Scale factor to multiple the incoming Vector2's Y component by.")]
    public float y
    Field Value
    Type Description
    Single

    Methods

    Process(Vector2, InputControl)

    Process the given value and return the result.

    Declaration
    public override Vector2 Process(Vector2 value, InputControl control)
    Parameters
    Type Name Description
    Vector2 value
    InputControl control

    Control that the value originally came from. This can be null if the value did not originate from a control. This can be the case, for example, if the processor sits on a composite binding (InputBindingComposite) as composites are not directly associated with controls but rather source their values through their child bindings.

    Returns
    Type Description
    Vector2

    Processed input value.

    Overrides
    UnityEngine.InputSystem.InputProcessor<UnityEngine.Vector2>.Process(UnityEngine.Vector2, UnityEngine.InputSystem.InputControl)
    Remarks

    The implementation of this method must not be stateful.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023