Toggle GameObject Visibility – Unity
if(gameObject.activeSelf){ gameObject.SetActive(false); }else{ gameObject.SetActive(true); }
if(gameObject.activeSelf){ gameObject.SetActive(false); }else{ gameObject.SetActive(true); }
using UnityEngine; using UnityEngine.Windows.Speech; public class SpeechRecogniser: MonoBehaviour { protected DictationRecognizer dictationRecognizer; void Start() { } // CALL THIS FUNCTION WHEN YOU WANT TO START LISTENING TO DICTATION public void startDictationRequest(){ // THIS IS REALLY IMPORTANT!! // If you are using the MRTK and have phrase recognition running, then you can’t use both at once, … Read more
This one is super simple and is just if(text.Contains(“your words here”)){ do something; }