void Start() { _ThrustersForwardEnabled = false; _ThrustersReverseEnabled = false; _YawLeftEnabled = false; _YawRightEnabled = false; _PitchUpEnabled = false; _PitchDownEnabled = false; _DockedToMagellan = false; _DockedToStation = false; _EnginesEnabled = true; if (ResetSwitch != null) { ResetSwitch.SetActive(false); } if (StatusText != null) { StatusText.text = "IDLE"; _StaticStatus = StatusText.text; } if (ThrustUpgradeText != null) { ThrustUpgradeText.text = ((int)((_ThrustPercentage - 1) * 100)).ToString() + "%"; } if (SpeechRecognizer.ExistsOnDevice()) { if (ComputerNotificationAudioSource != null) { ComputerNotificationAudioSource.Play(); } SpeechRecognizerListener listener = GameObject.FindObjectOfType <SpeechRecognizerListener>(); listener.onAuthorizationStatusFetched.AddListener(OnAuthorizationStatusFetched); listener.onAvailabilityChanged.AddListener(OnAvailabilityChange); listener.onErrorDuringRecording.AddListener(OnError); listener.onErrorOnStartRecording.AddListener(OnError); listener.onFinalResults.AddListener(OnFinalResult); listener.onPartialResults.AddListener(OnPartialResult); listener.onEndOfSpeech.AddListener(OnEndOfSpeech); SpeechRecognizer.SetDetectionLanguage("en-US"); SpeechRecognizer.RequestAccess(); } else { if (StatusText != null) { StatusText.text = "IDLE - VOICE COMMANDS NOT SUPPORTED"; _StaticStatus = StatusText.text; } } }
void SetLanguage(string id) { SpeechRecognizer.SetDetectionLanguage(id); }