API reference
API reference
Select your platform
No SDKs available
No versions available

DataModifier Class

A specialization of DataSource<TData> which consumes data from another IDataSource<TData>, modifies that data in some way, then makes the modified data available to downstream consumers.
Examples of this include Filter.HandFilter (which applies smoothing to hand tracking data) and SyntheticHand (which can change the position and shape of hand tracking data based on conditions in the scene).

Protected Fields

UnityEngine.Object _iModifyDataFromSourceMono[Get]
bool _applyModifier[Get]
override TData DataAsset[Get]

Properties

static TData InvalidAsset[Get]
Implementation of IDataSource.CurrentDataVersion; for details, please refer to the related documentation provided for that interface.

Fields

Returns the IDataSource<TData> from which this DataModifier retrieves the TData it modifies.
This source is typically set through the UnityEditor, but it can also be set programmatically using InjectModifyDataFromSource(IDataSource<TData>).

Member Functions

Changes the source from which this modifier retrieves the data it modifies, the source for updates, and the DataSource<TData>.UpdateModeFlags.
Typically, the same value is passed as both modifyDataFromSource and updateAfter so that the modifier is updated whenever and immediately after the source from which it retrieves the unmodified data acquires new data to modify.
Parameters
modifyDataFromSource
The source from which this modifier retrieves the data it modifies
updateAfter
The IDataSource after which this modifier should be updated
updateMode
The DataSource<TData>.UpdateModeFlags to use from now on
Injects all required dependencies for a dynamically instantiated DataModifier; effectively wraps DataSource<TData>.InjectAllDataSource(DataSource<TData>.UpdateModeFlags, IDataSource), InjectModifyDataFromSource(IDataSource<TData>), and InjectApplyModifier(bool).
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets the IDataSource<TData> for unmodified data on a dynamically instantiated DataModifier.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Parameters
updateMode
Sets whether or not to apply modification on a dynamically instantiated DataSource.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Parameters
updateMode

Protected Functions

virtual override void UpdateData ( )
abstract void Apply
( TData data )
virtual override void Start ( )
Did you find this page helpful?
Thumbs up icon
Thumbs down icon