DataConsumerGOBase Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Base class for IDataConsumer that must derive from a game object UnityEngine.MonoBehaviour.
[System.Serializable]
public abstract class DataConsumerGOBase : UnityEngine.MonoBehaviour, MixedReality.Toolkit.Data.IDataConsumer
[<System.Serializable>]
type DataConsumerGOBase = class
inherit MonoBehaviour
interface IDataConsumer
Public MustInherit Class DataConsumerGOBase
Inherits MonoBehaviour
Implements IDataConsumer
- Inheritance
-
UnityEngine.MonoBehaviourDataConsumerGOBase
- Derived
- Attributes
- Implements
Remarks
This class encapsulates as much of the basic logic that is needed to serve as a IDataConsumer, without getting into the specifics that might deviate based on the types of views being managed.
Although this may change in future implementations, since an IDataConsumer does not currently need to be discoverable by other game objects, this base class does not attempt to proxy a full IDataConsumer interface. It does however pass through many of the IDataConsumer methods to a non-Unity base class to reduce the mix of Unity and business logic.
Constructors
| Name | Description |
|---|---|
| DataConsumerGOBase() | |
Fields
| Name | Description |
|---|---|
| _attached | |
| _componentsToManage | |
| _dataController | |
| _dataSourcesByType | |
| _externalAttached | |
| _isQuitting | |
| _resolvedToLocalKeyPathLookup | |
| 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. |
Properties
| Name | Description |
|---|---|
| AutoAttachAndDetach |
If |
| DataController | |
| DataSources |
Note that runtime changes to this will not be reflected in the serialized data for this component. |
| 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. |
| IsFixedHierarchyWillUseCachedValues |
If |
| ResolvedKeyPathPrefix | |
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. |
| AddKeyPaths(HashSet<Component>) |
Once components have been identified, add keypaths for them. |
| AddVariableKeyPathsForAllComponents(ISet<Component>) | |
| AddVariableKeyPathsForComponent(Component) |
Add variable key paths for a component. |
| Attach(Dictionary<String,IDataSource>, IDataController, String) |
Prepare this data consumer for use and attach to the provided external resources. |
| AttachAllResources(Dictionary<String,IDataSource>, IDataController, String) | |
| AttachDataConsumer() |
Perform any attach logic here that is specific to this data consumer. |
| AttachDataSources(Dictionary<String,IDataSource>) | |
| CheckAndUpdateAttach(Dictionary<String,IDataSource>, IDataController, String) | |
| ComponentMeetsAllQualifications(Component) | |
| DataChangeSetBegin(IDataSource) |
Mark beginning of a related set of data changes. |
| DataChangeSetEnd(IDataSource) |
Mark beginning of a related set of data changes. |
| Detach() |
Detach this data consumer and prepare to return to object pool. |
| DetachDataConsumer() |
Perform any detach logic here that is specific to this data consumer. |
| FindComponentsOnGameObject(GameObject, Type) | |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| FindUnmanagedComponentsInChildren(GameObject, Type) | |
| GetBestDataSource(String) | |
| GetBestDataSourceForKeyPath(String, String, String) | |
| GetComponentTypes() |
Get the component types. |
| InitializeDataConsumer() |
Perform any one time initialization here that is specific to this data consumer. |
| IsAttached() |
Tell whether attached to a DataSource. |
| IsSameDataController(IDataController) | |
| IsSameDataSources(Dictionary<String,IDataSource>) | |
| IsSameKeyPathPrefix(String) | |
| ManageChildren() |
Report whether this data consumer should manage components on child game objects |
| NotifyDataChanged(IDataSource, String, Object, DataChangeType) |
Notification of a data change. |
| NotifyThisConsumerKeypathsAdded() | |
| OnDisable() |
A Unity event function that is called when the script component has been disabled. |
| OnEnable() |
A Unity event function that is called when the script component has been enabled. |
| ProcessDataChanged(IDataSource, String, String, Object, 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. |
| ShouldIncludeInactiveComponentsInChildren() |
Get whether or not to inactive child components should be included. |