Ejemplo n.º 1
0
        /// <summary>
        /// Instructs the SurfaceObserver to start updating the SpatialMapping mesh.
        /// </summary>
        public void StartObserver()
        {
#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
            logger.AppendMeshDebugText("Starting Observer...");
            if (!IsObserverRunning())
            {
                surfaceObserver.StartObserving();
                StartTime = Time.unscaledTime;
                logger.AppendMeshDebugText("Observer started");
            }
        }
    public void OnInputClicked(InputClickedEventData eventData)
    {
        // AirTap code goes here
        List <Mesh> meshes = SpatialMappingObject.GetComponent <SpatialMappingManager>().GetMeshes();

        logger.AppendMeshDebugText(meshes.Count.ToString() + " meshes.");
        foreach (Mesh mesh in meshes)
        {
            networkManager.sendSpatialMesh(mesh);
        }
        //if (!Observing)
        //{
        //    SpatialMappingObject.GetComponent<SpatialMappingManager>().StartObserver();
        //    Observing = !Observing;
        //} else
        //{
        //    SpatialMappingObject.GetComponent<SpatialMappingManager>().StopObserver();
        //    Observing = !Observing;
        //}
    }