We've moved!

Starting from MRTK 2.6, we are publishing both conceptual docs and API references on docs.microsoft.com. For conceptual docs, please visit our new landing page. For API references, please visit the MRTK-Unity section of the dot net API explorer. Existing content will remain here but will not be updated further.

Search Results for

    Show / Hide Table of Contents

    Class DemoSpatialMeshHandler

    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.

    Inheritance
    Object
    DemoSpatialMeshHandler
    Implements
    IMixedRealitySpatialAwarenessObservationHandler<SpatialAwarenessMeshObject>
    Namespace: Microsoft.MixedReality.Toolkit.Examples.Demos
    Assembly: cs.temp.dll.dll
    Syntax
    public class DemoSpatialMeshHandler : MonoBehaviour, IMixedRealitySpatialAwarenessObservationHandler<SpatialAwarenessMeshObject>

    Fields

    isRegistered

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

    Declaration
    protected bool isRegistered
    Field Value
    Type Description
    Boolean

    Methods

    AddToData(Int32)

    Records the mesh id when it is first added.

    Declaration
    protected void AddToData(int eventDataId)
    Parameters
    Type Name Description
    Int32 eventDataId

    OnDestroy()

    Declaration
    protected virtual void OnDestroy()

    OnDisable()

    Declaration
    protected virtual void OnDisable()

    OnEnable()

    Declaration
    protected virtual void OnEnable()

    OnObservationAdded(MixedRealitySpatialAwarenessEventData<SpatialAwarenessMeshObject>)

    Declaration
    public virtual void OnObservationAdded(MixedRealitySpatialAwarenessEventData<SpatialAwarenessMeshObject> eventData)
    Parameters
    Type Name Description
    MixedRealitySpatialAwarenessEventData<SpatialAwarenessMeshObject> eventData

    OnObservationRemoved(MixedRealitySpatialAwarenessEventData<SpatialAwarenessMeshObject>)

    Declaration
    public virtual void OnObservationRemoved(MixedRealitySpatialAwarenessEventData<SpatialAwarenessMeshObject> eventData)
    Parameters
    Type Name Description
    MixedRealitySpatialAwarenessEventData<SpatialAwarenessMeshObject> eventData

    OnObservationUpdated(MixedRealitySpatialAwarenessEventData<SpatialAwarenessMeshObject>)

    Declaration
    public virtual void OnObservationUpdated(MixedRealitySpatialAwarenessEventData<SpatialAwarenessMeshObject> eventData)
    Parameters
    Type Name Description
    MixedRealitySpatialAwarenessEventData<SpatialAwarenessMeshObject> eventData

    RegisterEventHandlers<T, U>()

    Registers for the spatial awareness system events.

    Declaration
    protected virtual void RegisterEventHandlers<T, U>()
        where T : IMixedRealitySpatialAwarenessObservationHandler<U> where U : BaseSpatialAwarenessObject
    Type Parameters
    Name Description
    T
    U

    RemoveFromData(Int32)

    Removes the mesh id.

    Declaration
    protected void RemoveFromData(int eventDataId)
    Parameters
    Type Name Description
    Int32 eventDataId

    Start()

    Declaration
    protected virtual void Start()

    UnregisterEventHandlers<T, U>()

    Unregisters from the spatial awareness system events.

    Declaration
    protected virtual void UnregisterEventHandlers<T, U>()
        where T : IMixedRealitySpatialAwarenessObservationHandler<U> where U : BaseSpatialAwarenessObject
    Type Parameters
    Name Description
    T
    U

    UpdateData(Int32)

    Increments the update count of the mesh with the id.

    Declaration
    protected void UpdateData(int eventDataId)
    Parameters
    Type Name Description
    Int32 eventDataId

    Implements

    IMixedRealitySpatialAwarenessObservationHandler<>
    In This Article
    Back to top Generated by DocFX