Language
Edit

IDataConsumer.Attach Method

Definition

Prepare this data consumer for use and attach to the provided external resources.

public void Attach(System.Collections.Generic.Dictionary<string,MixedReality.Toolkit.Data.IDataSource> dataSources, MixedReality.Toolkit.Data.IDataController controller, string resolvedKeyPathPrefix = default);
abstract member Attach : System.Collections.Generic.Dictionary<string, MixedReality.Toolkit.Data.IDataSource> * MixedReality.Toolkit.Data.IDataController * string -> unit
Public Sub Attach (dataSources As Dictionary(Of String, IDataSource), controller As IDataController, Optional resolvedKeyPathPrefix As String = Nothing)

Parameters

dataSources
Dictionary<String,IDataSource>

Which data sources to attach to for attaching a run-time loaded object, keyed to string DataType.

controller
IDataController

The data controller to use during the attach process.

resolvedKeyPathPrefix
String

The path prefix for this object to be appended to front of all local key paths.

Remarks

The use of this method is typically associated with a prefab item in a list when it is added to a list. It is called on each DataConsumer in the prefab when re-using a prefab that's newly instantiated or retrieved from an object pool.

Multiple data sources allows data to come from several places, typically useful for binding both data and themes.

This is typically not called from application level code or derived classes. It is public to allow DataConsumerCollection and similar aggregate consumers to attach any spawned child data consumers.

The AttachDataConsumer() function allows derived classes to perform additional attach tasks.

Applies to