#pragma warning restore 414, 649
        #endregion

        private void OnEnable()
        {
                        #if UNITY_EDITOR || WINDOWS_UWP
            // Setup hand interaction events
            InteractionManager.InteractionSourceLost     += SourceLost;
            InteractionManager.InteractionSourcePressed  += SourcePressed;
            InteractionManager.InteractionSourceReleased += SourceReleased;
            InteractionManager.InteractionSourceUpdated  += SourceUpdated;

            // Setup voice control events
            keywordRecognizer = new KeywordRecognizer(new string[] { "circle", "ball", "cube", "reset", "clear", "enable", "disable", "add", "up", "down", "white up", "white down", "save" });
            keywordRecognizer.OnPhraseRecognized += HeardKeyword;
            keywordRecognizer.Start();
                        #endif

            // Setup scene objects
            spheres.SetActive(false);
            shaderBalls.SetActive(true);
            cubes.SetActive(false);

            targetPos = transform.position;

            // Hook up resources
            lightCapture = FindObjectOfType <LightCapture>();

            // No hard dependence on the MRTK, just reflect into the parts we want to use
            Type textToSpeechType = Type.GetType("HoloToolkit.Unity.TextToSpeech");
            if (textToSpeechType != null)
            {
                tts         = (Component)FindObjectOfType(textToSpeechType);
                speakMethod = textToSpeechType.GetMethod("StartSpeaking");
            }
        }
#pragma warning restore 414, 649
        #endregion

        private void OnEnable()
        {
            #if UNITY_EDITOR || WINDOWS_UWP
            // Setup hand interaction events
            InteractionManager.InteractionSourceLost     += SourceLost;
            InteractionManager.InteractionSourcePressed  += SourcePressed;
            InteractionManager.InteractionSourceReleased += SourceReleased;
            InteractionManager.InteractionSourceUpdated  += SourceUpdated;

            // Setup voice control events
            keywordRecognizer = new KeywordRecognizer(new string[] { CMD_CIRCLE, CMD_BALL, CMD_CUBE, CMD_RESET, CMD_CLEAR, CMD_ENABLE, CMD_DISABLE, CMD_ADD, CMD_EXPOSURE_UP, CMD_EXPOSURE_DOWN, CMD_ISO_UP, CMD_ISO_DOWN, CMD_WHITE_UP, CMD_WHITE_DOWN, CMD_SAVE });
            keywordRecognizer.OnPhraseRecognized += HeardKeyword;
            keywordRecognizer.Start();
            #endif

            // Setup scene objects
            spheres.SetActive(false);
            shaderBalls.SetActive(true);
            cubes.SetActive(false);

            targetPos = transform.position;

            // Hook up resources
            lightCapture = FindObjectOfType <LightCapture>();

            // No hard dependence on the MRTK, just reflect into the parts we want to use
            Type textToSpeechType = Type.GetType("HoloToolkit.Unity.TextToSpeech");
            if (textToSpeechType != null)
            {
                tts         = (Component)FindObjectOfType(textToSpeechType);
                speakMethod = textToSpeechType.GetMethod("StartSpeaking");
            }
        }