docs.unity.cn
    Show / Hide Table of Contents

    Class ScaleVector3Processor

    Scale the components of a Vector3 by constant factors.

    Inheritance
    Object
    InputProcessor
    InputProcessor<Vector3>
    ScaleVector3Processor
    Inherited Members
    InputProcessor<Vector3>.ProcessAsObject(Object, InputControl)
    InputProcessor<Vector3>.Process(Void*, Int32, InputControl)
    InputProcessor.cachingPolicy
    Namespace: UnityEngine.InputSystem.Processors
    Syntax
    public class ScaleVector3Processor : InputProcessor<Vector3>
    Remarks

    This processor is registered (see RegisterProcessor<T>(String)) under the name "scaleVector3".

    // Double the magnitude of gravity values read from a gravity sensor.
    myAction.AddBinding("<GravitySensor>/gravity").WithProcessor("scaleVector3(x=2,y=2,z=2)");

    Fields

    x

    Scale factor to apply to the vector's x axis. Defaults to 1.

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

    y

    Scale factor to apply to the vector's y axis. Defaults to 1.

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

    z

    Scale factor to apply to the vector's z axis. Defaults to 1.

    Declaration
    [Tooltip("Scale factor to multiply the incoming Vector3's Z component by.")]
    public float z
    Field Value
    Type Description
    Single

    Methods

    Process(Vector3, InputControl)

    Return value scaled by x, y, and z.

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

    Input value.

    InputControl control

    Ignored.

    Returns
    Type Description
    Vector3

    Scaled vector.

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

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    Object.ToString()

    See Also

    ScaleProcessor
    ScaleVector2Processor
    Back to top Copyright © 2023 Unity Technologies
    Generated by DocFX
    on 27 March 2023
    Terms of use