コード例 #1
0
        /// <summary>
        /// On click event for the magnet model object.
        /// </summary>
        public void OnInputClicked(InputClickedEventData eventData)
        {
            if (isPlacingMagnet)
            {
                return;
            }

#if UNITY_UWP
            // On a real Hololens device, we'll navigate to the `FlatApp`.
            FlatAppHelper.NavigateToFlatApp();
#else
            // Alternatively, on the Unity Editor since we do not have access to the `FlatApp`,
            // we'll generate a default souvenir for debugging purposes.
            var souvenirManager = FindObjectOfType <SouvenirManager>();
            souvenirManager.CreateSouvenir("0", "PalmTree", string.Empty);
#endif
        }
コード例 #2
0
        private void Start()
        {
            keywords = new Dictionary <string, Action>();

            var voiceCommandsManager = FindObjectOfType <VoiceCommandsManager>();

            if (voiceCommandsManager != null)
            {
                voiceCommandsManager.SpeechKeywordRecognized += OnSpeechKeywordRecognized;
            }

            keywords.Add(VoiceCommandsManager.OpenMenuKeyword, () => { FlatAppHelper.NavigateToFlatApp(); });
            keywords.Add(VoiceCommandsManager.ToggleMeshKeyword, () => {
                if (SpatialMappingManager.IsInitialized)
                {
                    SpatialMappingManager.Instance.DrawVisualMeshes = !SpatialMappingManager.Instance.DrawVisualMeshes;
                }
            });
        }
コード例 #3
0
 /// <summary>
 /// Opens the flat app.
 /// </summary>
 protected void SwitchToFlatApp()
 {
     FlatAppHelper.NavigateToFlatApp();
 }
コード例 #4
0
 public void OnInputClicked(InputClickedEventData eventData)
 {
     FlatAppHelper.NavigateToFlatApp();
     Destroy(gameObject);
 }