Struct InputActionTrace.ActionEventPtr
A wrapper around UnityEngine.InputSystem.LowLevel.ActionEvent that automatically translates all the information in events into their high-level representations.
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
startTime
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 |
Exceptions
| Type | Condition |
|---|---|
| NullReferenceException | If |
| ArgumentException | If the given |
See Also
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 |
Type Parameters
| Name | Description |
|---|---|
| TValue | The event value type to be used. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | In case the size of |
ReadValueAsObject()
Reads the value associated with this event as an object.
Declaration
public object ReadValueAsObject()
Returns
| Type | Description |
|---|---|
| Object |
|
See Also
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String |