docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct InputActionTrace.ActionEventPtr

    A wrapper around ActionEvent that automatically translates all the information in events into their high-level representations.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    Namespace: UnityEngine.InputSystem.Utilities
    Assembly: Unity.InputSystem.dll
    Syntax
    public struct InputActionTrace.ActionEventPtr
    Remarks

    For example, instead of returning control indices, it automatically resolves and returns the respective controls.

    Properties

    action

    The InputAction associated with this action event.

    Declaration
    public InputAction action { get; }
    Property Value
    Type Description
    InputAction

    control

    The InputControl instance associated with this action event.

    Declaration
    public InputControl control { get; }
    Property Value
    Type Description
    InputControl

    duration

    The duration, in seconds, that has elapsed between when this event was generated and when the action phase transitioned to Started and has remained active.

    Declaration
    public double duration { get; }
    Property Value
    Type Description
    double

    interaction

    The IInputInteraction instance associated with this action event if applicable, or null if the action event is not associated with an input interaction.

    Declaration
    public IInputInteraction interaction { get; }
    Property Value
    Type Description
    IInputInteraction

    phase

    The InputActionPhase associated with this action event.

    Declaration
    public InputActionPhase phase { get; }
    Property Value
    Type Description
    InputActionPhase
    See Also
    phase
    phase

    startTime

    The time, in seconds since your game or app started, that the phase transitioned into Started.

    Declaration
    public double startTime { get; }
    Property Value
    Type Description
    double

    time

    The time, in seconds since your game or app started, that the event occurred.

    Declaration
    public double time { get; }
    Property Value
    Type Description
    double
    Remarks

    Times are in seconds and progress linearly in real-time. The timeline is the same as for realtimeSinceStartup.

    valueSizeInBytes

    The size, in bytes, of the value associated with this action event.

    Declaration
    public int valueSizeInBytes { get; }
    Property Value
    Type Description
    int

    Methods

    ReadValue(void*, int)

    Reads the value associated with this event into the contiguous memory buffer defined by [buffer, buffer + bufferSize).

    Declaration
    public void ReadValue(void* buffer, int bufferSize)
    Parameters
    Type Name Description
    void* buffer

    Pointer to the contiguous memory buffer to write value data to.

    int bufferSize

    The size, in bytes, of the contiguous buffer pointed to by buffer.

    Exceptions
    Type Condition
    NullReferenceException

    If buffer is null.

    ArgumentException

    If the given bufferSize is less than the number of bytes required to write the event value to buffer.

    See Also
    ReadValueAsObject()
    ReadValue<TValue>()

    ReadValueAsObject()

    Reads the value associated with this event as an object.

    Declaration
    public object ReadValueAsObject()
    Returns
    Type Description
    object

    object representing the value of this action event.

    See Also
    ReadOnlyArray<TValue>
    ReadValue(void*, int)

    ReadValue<TValue>()

    Reads the value associated with this event as an object of type TValue.

    Declaration
    public TValue ReadValue<TValue>() where TValue : struct
    Returns
    Type Description
    TValue

    Object of type TValue.

    Type Parameters
    Name Description
    TValue

    The event value type to be used.

    Exceptions
    Type Condition
    InvalidOperationException

    In case the size of TValue does not match the size of the value associated with this event.

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    ValueType.ToString()
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)