API reference

IDataSource Interface

Extends IDataSource
Interface expressing that an instance is an integration point from which data can be retrieved.
Any type that is a provider of a certain type of data (forwarding HandDataAsset data from the system as done by Hand, altering and re-forwarding HandDataAsset data based on scene state as done by SyntheticHand, etc.) should be a DataSource for that kind of data.
This is a base interface for many different types supplying many different types of data throughout the Interaction SDK. For example, Hands are sources for HandDataAssets, while Controllers are sources for ControllerDataAsset.
This is a conceptual increment on IDataSource, adding only a specification of the type of data provided and an accessor to retrieve that data.

Properties

CurrentDataVersion : int
[Get]
Indicator which is incremented every time new data becomes available.
Exceptionally high-frequency data in exceptionally long-running experiences can potentially overflow this value, leading to undefined behavior. While this is not expected to be a factor in typical cases, wildly high-frequency scenarios may need to destroy and recreate their IDataSources periodically to avoid hitting this limit.
Signature
int CurrentDataVersion

Events

InputDataAvailable : Action
Notifies observers that new data is available from this source.
Data is typically retrieved by calling IDataSource<TData>.GetData.
If observing a Hand instance, use Hand.WhenHandUpdated instead of this event.
Signature
Action InputDataAvailable

Methods

GetData ()
Retrieves the TData currently contained by this source.
If IDataSource.MarkInputDataRequiresUpdate has been called since the last invocation of this method, all required work to lazily update the contained data will be executed within this call.
Signature
TData GetData()
Returns
TData  The TData currently contained by this source
MarkInputDataRequiresUpdate ()
Marks the data asset (for example, HandDataAsset) stored as outdated, which means it should be re-processed the next time data is retrieved from this source.
Signature
void MarkInputDataRequiresUpdate()
Returns
void