Struct InputActionTrace.ActionEventPtr
A wrapper around ActionEvent that automatically translates all the information in events into their high-level representations.
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
startTime
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 |
Exceptions
Type | Condition |
---|---|
NullReferenceException | If |
ArgumentException | If the given |
See Also
ReadValueAsObject()
Reads the value associated with this event as an object
.
Declaration
public object ReadValueAsObject()
Returns
Type | Description |
---|---|
object |
|
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 |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |