Ejemplo n.º 1
0
    public void toggleSpatialMapping()
    {
        SpatialMappingObserver comp = SpatialMappingPrefab.GetComponent <SpatialMappingObserver>();

        if (comp.ObserverState == 0)
        {
            comp.StopObserving();
            SpatialMappingPrefab.SetActive(false);
        }
        else
        {
            SpatialMappingPrefab.SetActive(true);
            comp.StartObserving();
        }
    }
    /// <summary>
    /// Instructs the SurfaceObserver to stop updating the SpatialMapping mesh.
    /// </summary>
    public void StopObserver()
    {
#if UNITY_WSA
        // Allow observing if a device is present (Holographic Remoting)
#if UNITY_2017_2_OR_NEWER
        if (!UnityEngine.XR.XRDevice.isPresent)
        {
            return;
        }
#else
        if (!UnityEngine.VR.VRDevice.isPresent)
        {
            return;
        }
#endif
#endif
        if (IsObserverRunning())
        {
            surfaceObserver.StopObserving();
        }
    }
Ejemplo n.º 3
0
 public void EndScanning()
 {
     _spatialMappingObserver.StopObserving();
     SetMeshVisiblity(false);
 }