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

    Class InputProcessor

    A processor that conditions/transforms input values.

    Inheritance
    Object
    InputProcessor
    InputProcessor<TValue>
    Namespace: UnityEngine.InputSystem
    Syntax
    public abstract class InputProcessor
    Remarks

    To define a custom processor, it is usable best to derive from InputProcessor<TValue> instead of from this class. Doing so will avoid having to deal with things such as the raw memory buffers of Process(Void*, Int32, InputControl).

    Note, however, that if you do want to define a processor that can process more than one type of value, you can derive directly from this class.

    Methods

    Process(Void*, Int32, InputControl)

    Process an input value stored in the given memory buffer.

    Declaration
    public abstract void Process(void *buffer, int bufferSize, InputControl control)
    Parameters
    Type Name Description
    Void* buffer

    Memory buffer containing the input value. Must be at least large enough to hold one full value as indicated by bufferSize.

    Int32 bufferSize

    Size (in bytes) of the value inside buffer.

    InputControl control

    Optional control that the value originated from. Must have the same value type that the processor has.

    Remarks

    This method allows processing values of arbitrary size without allocating memory on the GC heap.

    ProcessAsObject(Object, InputControl)

    Process an input value, given as an object, and return the processed value as an object.

    Declaration
    public abstract object ProcessAsObject(object value, InputControl control)
    Parameters
    Type Name Description
    Object value

    A value matching the processor's value type.

    InputControl control

    Optional control that the value originated from. Must have the same value type that the processor has.

    Returns
    Type Description
    Object

    A processed value based on value.

    Remarks

    This method allocates GC heap memory. To process values without allocating GC memory, it is necessary to either know the value type of a processor at compile time and call Process(TValue, InputControl) directly or to use Process(Void*, Int32, InputControl) instead and process values in raw memory buffers.

    See Also

    processors
    processors
    RegisterProcessor<T>(String)
    GetParameterValue(InputAction, String, InputBinding)
    ApplyParameterOverride(InputActionMap, String, PrimitiveValue, InputBinding)
    概要
    • Methods
      • Process(Void*, Int32, InputControl)
      • ProcessAsObject(Object, InputControl)
    • See Also
    トップに戻る
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)