docs.unity.cn
    Show / Hide Table of Contents

    Class ScaleProcessor

    Scale a float value by a constant factor.

    Inheritance
    Object
    InputProcessor
    InputProcessor<Single>
    ScaleProcessor
    Inherited Members
    InputProcessor<Single>.ProcessAsObject(Object, InputControl)
    InputProcessor<Single>.Process(Void*, Int32, InputControl)
    Namespace: UnityEngine.InputSystem.Processors
    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
    public float factor
    Field Value
    Type Description
    Single

    Methods

    Process(Single, InputControl)

    Scale the given value by factor.

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

    Input value.

    InputControl control

    Ignored.

    Returns
    Type Description
    Single

    Scaled value.

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

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    See Also

    ScaleVector2Processor
    ScaleVector3Processor
    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Wednesday, January 5, 2022
    Terms of use