Class InputStateHistory
Record a history of state changes applied to one or more controls.
Inheritance
InputStateHistory
Assembly: Unity.InputSystem.dll
Syntax
public class InputStateHistory : IDisposable, IEnumerable<InputStateHistory.Record>, IEnumerable, IInputStateChangeMonitor
Constructors
InputStateHistory(IEnumerable<InputControl>)
Declaration
public InputStateHistory(IEnumerable<InputControl> controls)
Parameters
InputStateHistory(int)
Declaration
public InputStateHistory(int maxStateSizeInBytes)
Parameters
Type |
Name |
Description |
int |
maxStateSizeInBytes |
|
InputStateHistory(string)
Declaration
public InputStateHistory(string path)
Parameters
Type |
Name |
Description |
string |
path |
|
InputStateHistory(InputControl)
Declaration
public InputStateHistory(InputControl control)
Parameters
Properties
Count
Total number of state records currently captured in the history.
Declaration
public int Count { get; }
Property Value
Type |
Description |
int |
Number of records in the collection.
|
See Also
this[int]
Declaration
public InputStateHistory.Record this[int index] { get; set; }
Parameters
Type |
Name |
Description |
int |
index |
|
Property Value
controls
Declaration
public ReadOnlyArray<InputControl> controls { get; }
Property Value
Declaration
public int extraMemoryPerRecord { get; set; }
Property Value
historyDepth
Maximum number of records that can be recorded in the history.
Declaration
public int historyDepth { get; set; }
Property Value
Type |
Description |
int |
Upper limit on number of records.
|
Exceptions
onRecordAdded
Declaration
public Action<InputStateHistory.Record> onRecordAdded { get; set; }
Property Value
onShouldRecordStateChange
Declaration
public Func<InputControl, double, InputEventPtr, bool> onShouldRecordStateChange { get; set; }
Property Value
updateMask
Declaration
public InputUpdateType updateMask { get; set; }
Property Value
version
Current version stamp. Every time a record is stored in the history,
this is incremented by one.
Declaration
public uint version { get; }
Property Value
Type |
Description |
uint |
Version stamp that indicates the number of mutations.
|
See Also
Methods
AddRecord(Record)
Declaration
public InputStateHistory.Record AddRecord(InputStateHistory.Record record)
Parameters
Returns
AllocateRecord(out int)
Declaration
protected InputStateHistory.RecordHeader* AllocateRecord(out int index)
Parameters
Type |
Name |
Description |
int |
index |
|
Returns
Clear()
Declaration
Destroy()
Declaration
Dispose()
Declaration
~InputStateHistory()
Declaration
protected ~InputStateHistory()
GetEnumerator()
Declaration
public IEnumerator<InputStateHistory.Record> GetEnumerator()
Returns
GetRecord(int)
Declaration
protected InputStateHistory.RecordHeader* GetRecord(int index)
Parameters
Type |
Name |
Description |
int |
index |
|
Returns
Declaration
protected object ReadValueAsObject(InputStateHistory.RecordHeader* data)
Parameters
Returns
Declaration
protected TValue ReadValue<TValue>(InputStateHistory.RecordHeader* data) where TValue : struct
Parameters
Returns
Type Parameters
RecordIndexToUserIndex(int)
Declaration
protected int RecordIndexToUserIndex(int index)
Parameters
Type |
Name |
Description |
int |
index |
|
Returns
RecordStateChange(InputControl, void*, double)
Declaration
public InputStateHistory.Record RecordStateChange(InputControl control, void* statePtr, double time)
Parameters
Returns
RecordStateChange(InputControl, InputEventPtr)
Declaration
public InputStateHistory.Record RecordStateChange(InputControl control, InputEventPtr eventPtr)
Parameters
Returns
StartRecording()
Declaration
public void StartRecording()
StopRecording()
Declaration
public void StopRecording()
UserIndexToRecordIndex(int)
Declaration
protected int UserIndexToRecordIndex(int index)
Parameters
Type |
Name |
Description |
int |
index |
|
Returns
Implements