Class InputStateHistory
Record a history of state changes applied to one or more controls.
Inheritance
InputStateHistory
Syntax
public class InputStateHistory : IDisposable, IEnumerable<InputStateHistory.Record>, IEnumerable, IInputStateChangeMonitor
Constructors
InputStateHistory(IEnumerable<InputControl>)
Declaration
public InputStateHistory(IEnumerable<InputControl> controls)
Parameters
InputStateHistory(Int32)
Declaration
public InputStateHistory(int maxStateSizeInBytes)
Parameters
Type |
Name |
Description |
Int32 |
maxStateSizeInBytes |
|
InputStateHistory(String)
Declaration
public InputStateHistory(string path)
Parameters
Type |
Name |
Description |
String |
path |
|
InputStateHistory(InputControl)
Declaration
public InputStateHistory(InputControl control)
Parameters
Properties
controls
Declaration
public ReadOnlyArray<InputControl> controls { get; }
Property Value
Count
Total number of state records currently captured in the history.
Declaration
public int Count { get; }
Property Value
Type |
Description |
Int32 |
Number of records in the collection.
|
See Also
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 |
Int32 |
Upper limit on number of records.
|
Exceptions
Item[Int32]
Declaration
public InputStateHistory.Record this[int index] { get; set; }
Parameters
Type |
Name |
Description |
Int32 |
index |
|
Property Value
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 |
UInt32 |
Version stamp that indicates the number of mutations.
|
See Also
Methods
AddRecord(InputStateHistory.Record)
Declaration
public InputStateHistory.Record AddRecord(InputStateHistory.Record record)
Parameters
Returns
AllocateRecord(out Int32)
Declaration
protected InputStateHistory.RecordHeader*AllocateRecord(out int index)
Parameters
Type |
Name |
Description |
Int32 |
index |
|
Returns
Clear()
Declaration
Destroy()
Declaration
Dispose()
Declaration
Implements
Finalize()
Declaration
protected void Finalize()
GetEnumerator()
Declaration
public IEnumerator<InputStateHistory.Record> GetEnumerator()
Returns
Implements
GetRecord(Int32)
Declaration
protected InputStateHistory.RecordHeader*GetRecord(int index)
Parameters
Type |
Name |
Description |
Int32 |
index |
|
Returns
Declaration
protected TValue ReadValue<TValue>(InputStateHistory.RecordHeader*data)
where TValue : struct
Parameters
Returns
Type Parameters
Declaration
protected object ReadValueAsObject(InputStateHistory.RecordHeader*data)
Parameters
Returns
RecordIndexToUserIndex(Int32)
Declaration
protected int RecordIndexToUserIndex(int index)
Parameters
Type |
Name |
Description |
Int32 |
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(Int32)
Declaration
protected int UserIndexToRecordIndex(int index)
Parameters
Type |
Name |
Description |
Int32 |
index |
|
Returns
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Implements
IInputStateChangeMonitor.NotifyControlStateChanged(InputControl, Double, InputEventPtr, Int64)
Declaration
void IInputStateChangeMonitor.NotifyControlStateChanged(InputControl control, double time, InputEventPtr eventPtr, long monitorIndex)
Parameters
Implements
IInputStateChangeMonitor.NotifyTimerExpired(InputControl, Double, Int64, Int32)
Declaration
void IInputStateChangeMonitor.NotifyTimerExpired(InputControl control, double time, long monitorIndex, int timerIndex)
Parameters
Implements
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.