Editar

Compartilhar via


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.

public ref class DemoSpatialMeshHandler : UnityEngine::MonoBehaviour, Microsoft::MixedReality::Toolkit::SpatialAwareness::IMixedRealitySpatialAwarenessObservationHandler<Microsoft::MixedReality::Toolkit::SpatialAwareness::SpatialAwarenessMeshObject ^>, UnityEngine::EventSystems::IEventSystemHandler
[UnityEngine.AddComponentMenu("Scripts/MRTK/Examples/DemoSpatialMeshHandler")]
public class DemoSpatialMeshHandler : UnityEngine.MonoBehaviour, Microsoft.MixedReality.Toolkit.SpatialAwareness.IMixedRealitySpatialAwarenessObservationHandler<Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshObject>, UnityEngine.EventSystems.IEventSystemHandler
[<UnityEngine.AddComponentMenu("Scripts/MRTK/Examples/DemoSpatialMeshHandler")>]
type DemoSpatialMeshHandler = class
    inherit MonoBehaviour
    interface IMixedRealitySpatialAwarenessObservationHandler<SpatialAwarenessMeshObject>
    interface IEventSystemHandler
Public Class DemoSpatialMeshHandler
Inherits MonoBehaviour
Implements IEventSystemHandler, IMixedRealitySpatialAwarenessObservationHandler(Of SpatialAwarenessMeshObject)
Inheritance
UnityEngine.MonoBehaviour
DemoSpatialMeshHandler
Derived
Attributes
UnityEngine.AddComponentMenuAttribute
Implements
IMixedRealitySpatialAwarenessObservationHandler<SpatialAwarenessMeshObject> UnityEngine.EventSystems.IEventSystemHandler

Constructors

DemoSpatialMeshHandler()

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