Language
Edit

DataConsumerCommandDispatcher Class

Definition

Dispatch commands along with reference data bound to this consumer.

[UnityEngine.AddComponentMenu("MRTK/Data Binding/Consumers/Data Consumer Command Dispatcher")]
public class DataConsumerCommandDispatcher : MixedReality.Toolkit.Data.DataConsumerGOBase
[<UnityEngine.AddComponentMenu("MRTK/Data Binding/Consumers/Data Consumer Command Dispatcher")>]
type DataConsumerCommandDispatcher = class
    inherit DataConsumerGOBase
Public Class DataConsumerCommandDispatcher
Inherits DataConsumerGOBase
Inheritance
UnityEngine.MonoBehaviour
DataConsumerCommandDispatcher
Attributes
UnityEngine.AddComponentMenuAttribute

Remarks

This command dispatcher is useful for enabling UX elements, such as action buttons, to invoke functionality that is specific to this instance of an data bound entity. This is particularly useful in combination with DataConsumerCollection where each item is bound to different data and yet each item may wish to invoke functionality specific to itself via some form of unique identifier.

As an example, given a list of contacts that has been populated via data binding, each entry may have an "Edit" and a "Delete" button for that contact. With this component, it's possible to invoke a command from the "Edit" and "Delete" button prefabs that is automatically bound to the correct "contactID" field so that the command receiver is able to invoke the appropriate functionality for the specific contact associated with the contact ID.

Constructors

Name Description
DataConsumerCommandDispatcher()

Fields

Name Description
_attached (Inherited from DataConsumerGOBase)
_componentsToManage (Inherited from DataConsumerGOBase)
_dataController (Inherited from DataConsumerGOBase)
_dataObject
_dataSourcesByType (Inherited from DataConsumerGOBase)
_externalAttached (Inherited from DataConsumerGOBase)
_isQuitting (Inherited from DataConsumerGOBase)
_noDataObjectFound
_resolvedToLocalKeyPathLookup (Inherited from DataConsumerGOBase)
dataReferenceKeyPath
ignoreKeyPathPrefix

For items in collections, it can be useful to ignore the prefix prepended to local key paths, such as when it is used to look up theme data in a separate IDataSource.

(Inherited from DataConsumerGOBase)

Properties

Name Description
AutoAttachAndDetach

If true, will ensure that the attachment happens only once, and will not be detached. This is useful to optimize items that will never be recycled. This optimization is disabled automatically for collections.

(Inherited from DataConsumerGOBase)
DataController (Inherited from DataConsumerGOBase)
DataSources

Note that runtime changes to this will not be reflected in the serialized data for this component.

(Inherited from DataConsumerGOBase)
DataSourceTypes

Data source types used to identify an appropriate data source for automatic attachment. If no type is provided, the first data source found in parents will be used.

(Inherited from DataConsumerGOBase)
IsFixedHierarchyWillUseCachedValues

If true, indicates the hierarchy and managed components in this object will not change. This will use the cached types and component references to scan for after they are attained a first time. This avoids an extensive amount of UnityEngine.GameObject.GetComponent``1 in each Attach(Dictionary<String,IDataSource>, IDataController, String), which is super expensive especially for DataConsumerText.

(Inherited from DataConsumerGOBase)
ResolvedKeyPathPrefix (Inherited from DataConsumerGOBase)

Methods

Name Description
AddKeyPathListener(String, IDataSource)

Add a key path to the data source so that this object will be notified when it has changed.

(Inherited from DataConsumerGOBase)
AddKeyPaths(HashSet<Component>)

Once components have been identified, add keypaths for them.

(Inherited from DataConsumerGOBase)
AddVariableKeyPathsForAllComponents(ISet<Component>) (Inherited from DataConsumerGOBase)
AddVariableKeyPathsForComponent(Component)

Add variable key paths for a component.

(Inherited from DataConsumerGOBase)
Attach(Dictionary<String,IDataSource>, IDataController, String)

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

(Inherited from DataConsumerGOBase)
AttachAllResources(Dictionary<String,IDataSource>, IDataController, String) (Inherited from DataConsumerGOBase)
AttachDataConsumer()

Perform any attach logic here that is specific to this data consumer.

AttachDataSources(Dictionary<String,IDataSource>) (Inherited from DataConsumerGOBase)
CheckAndUpdateAttach(Dictionary<String,IDataSource>, IDataController, String) (Inherited from DataConsumerGOBase)
ComponentMeetsAllQualifications(Component) (Inherited from DataConsumerGOBase)
DataChangeSetBegin(IDataSource)

Mark beginning of a related set of data changes.

(Inherited from DataConsumerGOBase)
DataChangeSetEnd(IDataSource)

Mark beginning of a related set of data changes.

(Inherited from DataConsumerGOBase)
Detach()

Detach this data consumer and prepare to return to object pool.

(Inherited from DataConsumerGOBase)
DetachDataConsumer()

Perform any detach logic here that is specific to this data consumer.

FindComponentsOnGameObject(GameObject, Type) (Inherited from DataConsumerGOBase)
FindComponentsToManage()

Populate the caches of components that are being managed by this DataConsumer, based on the GetComponentTypes() provided. Separation of this method from the FindVariablesToManage() allows for calling this in Awake before the data sources may be present/ready if desired.

(Inherited from DataConsumerGOBase)
FindDataSources(String[], Dictionary<String,IDataSource>)

If no data source is provided directly, search through this object and its parents in game object hierarchy for the data source to use with this data consumer.

(Inherited from DataConsumerGOBase)
FindDataSourcesInParents(String[], Dictionary<String,IDataSource>)

Search through this object and its parents in game object hierarchy for the data source to use with this data consumer.

(Inherited from DataConsumerGOBase)
FindDataSourcesInSingleton(String[], Dictionary<String,IDataSource>)

Search through this object and its parents in game object hierarchy for the data source to use with this data consumer.

(Inherited from DataConsumerGOBase)
FindNearestDataController(IDataController)

If no data source is provided directly, search through this object and its parents in game object hierarchy for the data source to use with this data consumer.

(Inherited from DataConsumerGOBase)
FindUnmanagedComponentsInChildren(GameObject, Type) (Inherited from DataConsumerGOBase)
GetBestDataSource(String) (Inherited from DataConsumerGOBase)
GetBestDataSourceForKeyPath(String, String, String) (Inherited from DataConsumerGOBase)
GetComponentTypes()

Get the component types.

(Inherited from DataConsumerGOBase)
InitializeDataConsumer()

Perform any one time initialization here that is specific to this data consumer.

(Inherited from DataConsumerGOBase)
IsAttached()

Tell whether attached to a DataSource.

(Inherited from DataConsumerGOBase)
IsSameDataController(IDataController) (Inherited from DataConsumerGOBase)
IsSameDataSources(Dictionary<String,IDataSource>) (Inherited from DataConsumerGOBase)
IsSameKeyPathPrefix(String) (Inherited from DataConsumerGOBase)
ManageChildren()

Report whether this data consumer should manage components on child game objects

(Inherited from DataConsumerGOBase)
NotifyDataChanged(IDataSource, String, Object, DataChangeType)

Notification of a data change.

(Inherited from DataConsumerGOBase)
NotifyThisConsumerKeypathsAdded() (Inherited from DataConsumerGOBase)
OnDisable()

A Unity event function that is called when the script component has been disabled.

(Inherited from DataConsumerGOBase)
OnEnable()

A Unity event function that is called when the script component has been enabled.

(Inherited from DataConsumerGOBase)
ProcessDataChanged(IDataSource, String, String, Object, DataChangeType) UnityEngine.MonoBehaviour.ProcessDataChanged(MixedReality.Toolkit.Data.IDataSource,System.String,System.String,System.Object,MixedReality.Toolkit.Data.DataChangeType)
SelfAttach()

Self attach is used when this Component is not being attached by another DataConsumer as would happen when DataConsumerCollection is instantiating prefabs and adding them to its collection.

(Inherited from DataConsumerGOBase)
SendCommand(String, Dictionary<String,Object>)

Send a command through the IDataController, with optional parameters

SendCommand(String)

Send a command through the Data Controller with no optional parameters

ShouldIncludeInactiveComponentsInChildren()

Get whether or not to inactive child components should be included.

(Inherited from DataConsumerGOBase)

Applies to