1using System.Runtime.Serialization;
2using System.Collections;
5using System.Diagnostics;
14 internal string selectedLanguage;
15 internal string textToSpeak;
16 private bool deactivated;
17 private bool once =
true;
19 public override void Start()
24 selector.onValueChanged.AddListener(OnDropdownChanged);
27 private void FillDropdown()
30 var languages =
VoiceTTS.InstalledLanguages();
31 if (languages.Length == 0)
return;
32 foreach (var o
in languages)
selector.options.Add(
new Dropdown.OptionData(o));
34 if (!
string.IsNullOrEmpty(selectedLanguage))
36 for (var i = 0; i <
selector.options.Count; i++)
37 if (
selector.options[i].text == selectedLanguage)
47 selectedLanguage = languages[0];
51 public void OnTextEditFinished(
string value)
54 VoiceTTS.Speak(textToSpeak, selectedLanguage);
57 public void OnDropdownChanged(
int value)
59 selectedLanguage =
selector.options[value].text;
78 var proc =
VoiceTTS.Speak(textToSpeak, selectedLanguage);
81 StartCoroutine(waiter(proc));
89 public IEnumerator waiter(Process p)
105 public void TriggerNow()
111 public new void GetObjectData(SerializationInfo info, StreamingContext context)
113 base.GetObjectData(info, context);
114 info.AddValue(
"lang", selectedLanguage, typeof(
string));
115 info.AddValue(
"textToSpeak", textToSpeak, typeof(
string));
118 public VoiceAction(SerializationInfo info, StreamingContext context) : base(info, context)
120 selectedLanguage = (string) info.GetValue(
"lang", typeof(
string));
121 textToSpeak = info.GetString(
"textToSpeak");
virtual void Deactivate()
void TriggerOutput(string id)
virtual void Triggered(string id)
List< GameObject > outPuts
virtual void GetObjectData(SerializationInfo info, StreamingContext context)
void showBlur(Process p, string text)
static BlurTheScene Instance