DemoSpatialMeshHandler Class

Definition

This class is an example of the IMixedRealitySpatialAwarenessObservationHandler<T> interface. It keeps track of the IDs of each mesh and tracks the number of updates they have received.

C++
public ref class DemoSpatialMeshHandler : UnityEngine::MonoBehaviour, Microsoft::MixedReality::Toolkit::SpatialAwareness::IMixedRealitySpatialAwarenessObservationHandler<Microsoft::MixedReality::Toolkit::SpatialAwareness::SpatialAwarenessMeshObject ^>, UnityEngine::EventSystems::IEventSystemHandler
Inheritance
UnityEngine.MonoBehaviour
DemoSpatialMeshHandler
Derived
Attributes
UnityEngine.AddComponentMenuAttribute
Implements
IMixedRealitySpatialAwarenessObservationHandler<SpatialAwarenessMeshObject> UnityEngine.EventSystems.IEventSystemHandler

Constructors

Fields

isRegistered

Value indicating whether or not this script has registered for spatial awareness events.

Methods

AddToData(Int32)

Records the mesh id when it is first added.

OnDestroy()
OnDisable()
OnEnable()
OnObservationAdded(MixedRealitySpatialAwarenessEventData<SpatialAwarenessMeshObject>)

Called when a spatial observer adds a new observation.

OnObservationRemoved(MixedRealitySpatialAwarenessEventData<SpatialAwarenessMeshObject>)

Called when a spatial observer removes a previous observation.

OnObservationUpdated(MixedRealitySpatialAwarenessEventData<SpatialAwarenessMeshObject>)

Called when a spatial observer updates a previous observation.

RegisterEventHandlers<T,U>()

Registers for the spatial awareness system events.

RemoveFromData(Int32)

Removes the mesh id.

Start()
UnregisterEventHandlers<T,U>()

Unregisters from the spatial awareness system events.

UpdateData(Int32)

Increments the update count of the mesh with the id.

Applies to

Product Versions
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0