// Use for initialization. private void Start() { PhysicsRaycastMask = 1 << PhysicsLayer; remoteMeshTarget = FindObjectOfType <RemoteMeshTarget>(); #if !UNITY_EDITOR StartObserver(); #endif #if UNITY_EDITOR fileSurfaceObserver = GetComponent <FileSurfaceObserver>(); if (fileSurfaceObserver != null) { // In the Unity editor, try loading a saved mesh. fileSurfaceObserver.Load(fileSurfaceObserver.MeshFileName); if (fileSurfaceObserver.GetMeshFilters().Count > 0) { SetSpatialMappingSource(fileSurfaceObserver); } else if (remoteMeshTarget != null) { SetSpatialMappingSource(remoteMeshTarget); } } #endif }
// Use for initialization. private void Start() { remoteMeshTarget = FindObjectOfType <RemoteMeshTarget>(); if (autoStartObserver) { StartObserver(); } }
// Use this for initialization. private void Start() { // Create our keyword collection. keywordCollection = new Dictionary <string, System.Action>(); keywordCollection.Add(SendMeshesKeyword, () => SendMeshes()); // Tell the KeywordRecognizer about our keywords. keywordRecognizer = new KeywordRecognizer(keywordCollection.Keys.ToArray()); // Register a callback for the KeywordRecognizer and start recognizing. keywordRecognizer.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized; keywordRecognizer.Start(); #if UNITY_EDITOR remoteMeshTarget = GetComponent <RemoteMeshTarget>(); if (remoteMeshTarget != null && SpatialMappingManager.Instance.Source == null) { // Use the network-based mapping source to receive meshes in the Unity editor. SpatialMappingManager.Instance.SetSpatialMappingSource(remoteMeshTarget); } #endif }