Struct InputStateHistory.Record
State change record
Implements
Namespace: UnityEngine.InputSystem.LowLevel
Assembly: Unity.InputSystem.dll
Syntax
public struct InputStateHistory.Record : IEquatable<InputStateHistory.Record>
Remarks
Input State change record stored in the InputStateHistory.
Properties
control
The control associated with the input state record.
Declaration
public InputControl control { get; }
Property Value
| Type | Description |
|---|---|
| InputControl | The control associated with the input state record. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | When the record is no longer value. |
See Also
index
The index of the input state record in the owning container.
Declaration
public int index { get; }
Property Value
| Type | Description |
|---|---|
| int | The index of the input state record in the owning container. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | When the record is no longer value. |
See Also
next
The next input state record in the owning container.
Declaration
public InputStateHistory.Record next { get; }
Property Value
| Type | Description |
|---|---|
| InputStateHistory.Record | The next input state record in the owning InputStateHistorycontainer. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | When the record is no longer value. |
See Also
owner
Identifies the owning container for the record.
Declaration
public InputStateHistory owner { get; }
Property Value
| Type | Description |
|---|---|
| InputStateHistory | The owning InputStateHistory container for the record. |
Remarks
Identifies the owning InputStateHistory container for the record.
See Also
previous
The previous input state record in the owning container.
Declaration
public InputStateHistory.Record previous { get; }
Property Value
| Type | Description |
|---|---|
| InputStateHistory.Record | The previous input state record in the owning InputStateHistorycontainer. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | When the record is no longer value. |
See Also
time
The time stamp of the input state record.
Declaration
public double time { get; }
Property Value
| Type | Description |
|---|---|
| double | The time stamp of the input state record in the owning container. currentTime |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | When the record is no longer value. |
See Also
valid
Identifies if the record is valid.
Declaration
public bool valid { get; }
Property Value
| Type | Description |
|---|---|
| bool | True if the record is a valid entry. False if invalid. |
Remarks
When the history is cleared with Clear() the entries become invalid.
See Also
Methods
CopyFrom(Record)
Copy data from one record to another.
Declaration
public void CopyFrom(InputStateHistory.Record record)
Parameters
| Type | Name | Description |
|---|---|---|
| InputStateHistory.Record | record | Source record to copy from. |
Remarks
Copy data from one record to another.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | When the source record history is not valid. |
| InvalidOperationException | When the control is not tracked by the owning InputStateHistory container. |
See Also
Equals(object)
Compare two records.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The record to compare with. |
Returns
| Type | Description |
|---|---|
| bool | True if the records are the same, False if they differ. |
Overrides
Remarks
Compare two records.
See Also
Equals(Record)
Compare two records.
Declaration
public bool Equals(InputStateHistory.Record other)
Parameters
| Type | Name | Description |
|---|---|---|
| InputStateHistory.Record | other | The record to compare with. |
Returns
| Type | Description |
|---|---|
| bool | True if the records are the same, False if they differ. |
Remarks
Compare two records.
See Also
GetHashCode()
Return the hash code of the record.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | The hash code of the record. |
Overrides
Remarks
Return the hash code of the record.
See Also
GetUnsafeExtraMemoryPtr()
Read the extra memory for the record.
Declaration
public void* GetUnsafeExtraMemoryPtr()
Returns
| Type | Description |
|---|---|
| void* | The extra memory for the record. |
Remarks
Additional date can be stored in a record in the extra memory section.
See Also
GetUnsafeMemoryPtr()
Read the state memory for the record.
Declaration
public void* GetUnsafeMemoryPtr()
Returns
| Type | Description |
|---|---|
| void* | The state memory for the record. |
Remarks
Read the state memory for the record.
See Also
ReadValueAsObject()
Read the control's final, processed value from the given state and return the value as an object.
Declaration
public object ReadValueAsObject()
Returns
| Type | Description |
|---|---|
| object | The value of the control associated with the record. |
Remarks
This method allocates GC memory and should not be used during normal gameplay operation.
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | When the specified value is not present. |
See Also
ReadValue<TValue>()
Returns value from the control in the record.
Declaration
public TValue ReadValue<TValue>() where TValue : struct
Returns
| Type | Description |
|---|---|
| TValue | Returns the value from the record. |
Type Parameters
| Name | Description |
|---|---|
| TValue | The type of the value being read |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | When the record is no longer value or the specified type is not present. |
See Also
ToString()
Return the string representation of the record.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The string representation of the record. |
Overrides
Remarks
Includes the control, value and time of the record (or <Invalid> if not valid).