docs.unity3d.com
    目次を表示する/隠す

    Class ClampProcessor

    Clamp a floating-point input to between min and max. This is equivalent to Mathf.Clamp(value, min, max).

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

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

    Note that no normalization is performed. If you want to re-normalize the input value after clamping, add a NormalizeProcessor. Alternatively, add a AxisDeadzoneProcessor which both clamps and normalizes.

    // Bind to right trigger on gamepad such that the value never drops below 0.3 and never goes // above 0.7. new InputAction(binding: "<Gamepad>/rightTrigger", processors: "clamp(min=0.3,max=0.7)");

    Fields

    max

    Maximum value (inclusive!) of the accepted value range.

    Declaration
    public float max
    Field Value
    Type Description
    Single

    min

    Minimum value (inclusive!) of the accepted value range.

    Declaration
    public float min
    Field Value
    Type Description
    Single

    Methods

    Process(Single, InputControl)

    Clamp value to the range of min and max.

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

    Input value.

    InputControl control

    Ignored.

    Returns
    Type Description
    Single

    Clamped value.

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

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    Object.ToString()
    トップに戻る
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)