// Use this for initialization.
        private void Start()
        {
#if UNITY_WSA || UNITY_STANDALONE_WIN
            // Create our keyword collection.
            keywordCollection = new Dictionary <string, System.Action> {
                { 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();
#endif

#if UNITY_EDITOR || UNITY_STANDALONE
            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
        }
示例#2
0
        // Use this for initialization.
        private void Start()
        {
#if UNITY_EDITOR || UNITY_STANDALONE
            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
        }