docs.unity3d.com
    Show / Hide Table of Contents

    Struct InputActionTrace.ActionEventPtr

    A wrapper around UnityEngine.InputSystem.LowLevel.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
    Syntax
    public struct ActionEventPtr
    Remarks

    For example, instead of returning UnityEngine.InputSystem.LowLevel.ActionEvent.controlIndex, it automatically resolves and returns the respective InputControl.

    Properties

    action

    The InputAction associated with this action event.

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

    control

    The InputControl instance associated with this action event.

    Declaration
    public readonly 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 readonly 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 readonly IInputInteraction interaction { get; }
    Property Value
    Type Description
    IInputInteraction

    phase

    The InputActionPhase associated with this action event.

    Declaration
    public readonly 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 readonly 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 readonly 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 readonly int valueSizeInBytes { get; }
    Property Value
    Type Description
    Int32

    Methods

    ReadValue(Void*, Int32)

    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.

    Int32 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>()

    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.

    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*, Int32)

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    ValueType.ToString()
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023