public void Start() { // Disable if no microphone devices are found if (Microphone.devices.Length == 0) { enabled = false; return; } if (KeywordSource == KeywordSourceEnum.None) { return; } keyWord = string.Empty; switch (KeywordSource) { case KeywordSourceEnum.ButtonText: default: CompoundButtonText text = GetComponent <CompoundButtonText>(); keyWord = prevButtonText = text.Text; break; case KeywordSourceEnum.LocalOverride: keyWord = Keyword; break; } KeywordManager.Instance.AddKeyword(keyWord, new KeywordManager.KeywordRecognizedDelegate(KeywordHandler), ConfidenceLevel); }
public void Start() { if (KeywordSource == KeywordSourceEnum.None) { return; } string keyWord = string.Empty; switch (KeywordSource) { case KeywordSourceEnum.ButtonText: default: CompoundButtonText text = GetComponent <CompoundButtonText>(); keyWord = text.Text; break; case KeywordSourceEnum.LocalOverride: keyWord = Keyword; break; } KeywordManager.Instance.AddKeyword(keyWord, new KeywordManager.KeywordRecognizedDelegate(KeywordHandler), ConfidenceLevel); }