Add handling of speech errors
This commit is contained in:
parent
97863be2c5
commit
0755ed60ac
@ -23,13 +23,35 @@
|
|||||||
BTC.StopSpeechIntentRecognition()
|
BTC.StopSpeechIntentRecognition()
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
|
|
||||||
BTC.Show("GO.HANDMENU.SpeechButton")
|
Composite(Marathon) {
|
||||||
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Restart")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.Show("GO.HANDMENU.Option1Button")
|
BTC.Hide("GO.HINTS.SitDownHint")
|
||||||
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
|
BTC.Hide("GO.HINTS.StandUpHint")
|
||||||
BTC.Hide("GO.HANDMENU.Option1Button")
|
}
|
||||||
BTC.Hide("GO.HANDMENU.SpeechButton")
|
|
||||||
BTC.Hide("GO.HANDMENU.SpeechOptions")
|
Composite(Selector) {
|
||||||
|
Composite(Sequence) {
|
||||||
|
BTC.CompareSpeechError("Rate limit is exceeded")
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Hold on")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Der SpeechService ist momentan nicht\nverfügbar. In 30 Sekunden geht es weiter.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
BTC.Wait(30)
|
||||||
|
}
|
||||||
|
|
||||||
|
Composite(Sequence) {
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Fehler")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Es besteht ein Problem mit der Internetverbindung.\nBringe das VR Headset bitte zu deiner Lehrperson.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
|
||||||
|
Decorator(Repeat) {
|
||||||
|
BTC.Wait(60)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -67,7 +89,7 @@ Tree("05_Tutorial") {
|
|||||||
|
|
||||||
BTC.SynthesizeText("Gut, jetzt testen wir aber mal dein Mikrofon. Wie heisst du eigentlich?")
|
BTC.SynthesizeText("Gut, jetzt testen wir aber mal dein Mikrofon. Wie heisst du eigentlich?")
|
||||||
BTC.SpeechOutputEnded()
|
BTC.SpeechOutputEnded()
|
||||||
BTC.Show("GO.ANIMATIONS.SpeechHint")
|
BTC.Show("GO.HINTS.SpeakHint")
|
||||||
|
|
||||||
BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-8")
|
BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-8")
|
||||||
BTC.StartSpeechIntentRecognition()
|
BTC.StartSpeechIntentRecognition()
|
||||||
@ -89,7 +111,7 @@ Tree("05_Tutorial") {
|
|||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BTC.Hide("GO.ANIMATIONS.SpeechHint")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.SynthesizeText("Schön dich kennenzulernen!")
|
BTC.SynthesizeText("Schön dich kennenzulernen!")
|
||||||
BTC.SpeechOutputEnded()
|
BTC.SpeechOutputEnded()
|
||||||
}
|
}
|
||||||
@ -98,14 +120,14 @@ Tree("05_Tutorial") {
|
|||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
BTC.Wait(5)
|
BTC.Wait(5)
|
||||||
BTC.CompareUserSpeechInputStarted(false)
|
BTC.CompareUserSpeechInputStarted(false)
|
||||||
BTC.Hide("GO.ANIMATIONS.SpeechHint")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.AbortSpeechEventListener()
|
BTC.AbortSpeechEventListener()
|
||||||
BTC.StopSpeechIntentRecognition()
|
BTC.StopSpeechIntentRecognition()
|
||||||
|
|
||||||
BTC.SynthesizeText("Ich habe dich nicht verstanden. Sprich bitte deutlicher.")
|
BTC.SynthesizeText("Ich habe dich nicht verstanden. Sprich bitte deutlicher.")
|
||||||
BTC.SpeechOutputEnded()
|
BTC.SpeechOutputEnded()
|
||||||
|
|
||||||
BTC.Show("GO.ANIMATIONS.SpeechHint")
|
BTC.Show("GO.HINTS.SpeakHint")
|
||||||
BTC.StartSpeechIntentRecognition()
|
BTC.StartSpeechIntentRecognition()
|
||||||
|
|
||||||
Composite(Race) {
|
Composite(Race) {
|
||||||
@ -125,7 +147,7 @@ Tree("05_Tutorial") {
|
|||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BTC.Hide("GO.ANIMATIONS.SpeechHint")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.SynthesizeText("Schön dich kennenzulernen!")
|
BTC.SynthesizeText("Schön dich kennenzulernen!")
|
||||||
BTC.SpeechOutputEnded()
|
BTC.SpeechOutputEnded()
|
||||||
}
|
}
|
||||||
@ -134,7 +156,7 @@ Tree("05_Tutorial") {
|
|||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
BTC.Wait(10)
|
BTC.Wait(10)
|
||||||
BTC.CompareUserSpeechInputStarted(false)
|
BTC.CompareUserSpeechInputStarted(false)
|
||||||
BTC.Hide("GO.ANIMATIONS.SpeechHint")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.AbortSpeechEventListener()
|
BTC.AbortSpeechEventListener()
|
||||||
BTC.StopSpeechIntentRecognition()
|
BTC.StopSpeechIntentRecognition()
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
@ -161,7 +183,7 @@ Tree("05_Tutorial") {
|
|||||||
|
|
||||||
BTC.SetSpeechRecognitionLanguage("de-DE")
|
BTC.SetSpeechRecognitionLanguage("de-DE")
|
||||||
BTC.SetVoiceName("de-DE-SeraphinaMultilingualNeural")
|
BTC.SetVoiceName("de-DE-SeraphinaMultilingualNeural")
|
||||||
BTC.Show("GO.ANIMATIONS.SpeechHint")
|
BTC.Show("GO.HINTS.SpeakHint")
|
||||||
|
|
||||||
BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-15")
|
BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-15")
|
||||||
BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-16")
|
BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-16")
|
||||||
@ -183,21 +205,21 @@ Tree("05_Tutorial") {
|
|||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
BTC.CompareIntentID("Zugabteil-Tutorial-U-15")
|
BTC.CompareIntentID("Zugabteil-Tutorial-U-15")
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
BTC.Hide("GO.ANIMATIONS.SpeechHint")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.SynthesizeText("Ah, Spaghetti mag ich auch!")
|
BTC.SynthesizeText("Ah, Spaghetti mag ich auch!")
|
||||||
BTC.SpeechOutputEnded()
|
BTC.SpeechOutputEnded()
|
||||||
}
|
}
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
BTC.CompareIntentID("Zugabteil-Tutorial-U-16")
|
BTC.CompareIntentID("Zugabteil-Tutorial-U-16")
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
BTC.Hide("GO.ANIMATIONS.SpeechHint")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.SynthesizeText("Ah, Pizza mag ich auch!")
|
BTC.SynthesizeText("Ah, Pizza mag ich auch!")
|
||||||
BTC.SpeechOutputEnded()
|
BTC.SpeechOutputEnded()
|
||||||
}
|
}
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
BTC.CompareIntentID("Zugabteil-Tutorial-U-17")
|
BTC.CompareIntentID("Zugabteil-Tutorial-U-17")
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
BTC.Hide("GO.ANIMATIONS.SpeechHint")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.SynthesizeText("Ah, Risotto mag ich auch!")
|
BTC.SynthesizeText("Ah, Risotto mag ich auch!")
|
||||||
BTC.SpeechOutputEnded()
|
BTC.SpeechOutputEnded()
|
||||||
}
|
}
|
||||||
@ -207,7 +229,7 @@ Tree("05_Tutorial") {
|
|||||||
// Selector 2: Fallback Button
|
// Selector 2: Fallback Button
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
Composite(Marathon) {
|
Composite(Marathon) {
|
||||||
BTC.Hide("GO.ANIMATIONS.SpeechHint")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.Show("GO.HANDMENU.SpeechButton")
|
BTC.Show("GO.HANDMENU.SpeechButton")
|
||||||
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Spaghetti")
|
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Spaghetti")
|
||||||
BTC.Show("GO.HANDMENU.Option1Button")
|
BTC.Show("GO.HANDMENU.Option1Button")
|
||||||
@ -267,7 +289,7 @@ Tree("05_Tutorial") {
|
|||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
BTC.Wait(5)
|
BTC.Wait(5)
|
||||||
BTC.CompareUserSpeechInputStarted(false)
|
BTC.CompareUserSpeechInputStarted(false)
|
||||||
BTC.Hide("GO.ANIMATIONS.SpeechHint")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.AbortSpeechEventListener()
|
BTC.AbortSpeechEventListener()
|
||||||
BTC.StopSpeechIntentRecognition()
|
BTC.StopSpeechIntentRecognition()
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
|
@ -37,13 +37,35 @@
|
|||||||
BTC.StopSpeechIntentRecognition()
|
BTC.StopSpeechIntentRecognition()
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
|
|
||||||
BTC.Show("GO.HANDMENU.SpeechButton")
|
Composite(Marathon) {
|
||||||
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Restart")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.Show("GO.HANDMENU.Option1Button")
|
BTC.Hide("GO.HINTS.SitDownHint")
|
||||||
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
|
BTC.Hide("GO.HINTS.StandUpHint")
|
||||||
BTC.Hide("GO.HANDMENU.Option1Button")
|
}
|
||||||
BTC.Hide("GO.HANDMENU.SpeechButton")
|
|
||||||
BTC.Hide("GO.HANDMENU.SpeechOptions")
|
Composite(Selector) {
|
||||||
|
Composite(Sequence) {
|
||||||
|
BTC.CompareSpeechError("Rate limit is exceeded")
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Hold on")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Der SpeechService ist momentan nicht\nverfügbar. In 30 Sekunden geht es weiter.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
BTC.Wait(30)
|
||||||
|
}
|
||||||
|
|
||||||
|
Composite(Sequence) {
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Fehler")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Es besteht ein Problem mit der Internetverbindung.\nBringe das VR Headset bitte zu deiner Lehrperson.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
|
||||||
|
Decorator(Repeat) {
|
||||||
|
BTC.Wait(60)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,13 +21,35 @@
|
|||||||
BTC.StopSpeechIntentRecognition()
|
BTC.StopSpeechIntentRecognition()
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
|
|
||||||
BTC.Show("GO.HANDMENU.SpeechButton")
|
Composite(Marathon) {
|
||||||
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Restart")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.Show("GO.HANDMENU.Option1Button")
|
BTC.Hide("GO.HINTS.SitDownHint")
|
||||||
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
|
BTC.Hide("GO.HINTS.StandUpHint")
|
||||||
BTC.Hide("GO.HANDMENU.Option1Button")
|
}
|
||||||
BTC.Hide("GO.HANDMENU.SpeechButton")
|
|
||||||
BTC.Hide("GO.HANDMENU.SpeechOptions")
|
Composite(Selector) {
|
||||||
|
Composite(Sequence) {
|
||||||
|
BTC.CompareSpeechError("Rate limit is exceeded")
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Hold on")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Der SpeechService ist momentan nicht\nverfügbar. In 30 Sekunden geht es weiter.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
BTC.Wait(30)
|
||||||
|
}
|
||||||
|
|
||||||
|
Composite(Sequence) {
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Fehler")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Es besteht ein Problem mit der Internetverbindung.\nBringe das VR Headset bitte zu deiner Lehrperson.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
|
||||||
|
Decorator(Repeat) {
|
||||||
|
BTC.Wait(60)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,9 +13,6 @@
|
|||||||
|
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
RunTree("22_Geschaeft_Story_A_Picknicken_Baeckerei_Intro")
|
RunTree("22_Geschaeft_Story_A_Picknicken_Baeckerei_Intro")
|
||||||
//RunTree("22_Geschaeft_Story_A_Picknicken_Mitnehmen")
|
|
||||||
//RunTree("22_Geschaeft_Story_A_Picknicken_Dank_Einkauf")
|
|
||||||
//RunTree("22_Geschaeft_Story_A_Picknicken_Baeckerei_Outro")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,13 +23,35 @@
|
|||||||
BTC.StopSpeechIntentRecognition()
|
BTC.StopSpeechIntentRecognition()
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
|
|
||||||
BTC.Show("GO.GO.SpeechButton")
|
Composite(Marathon) {
|
||||||
BTC.Set("TextMeshPro.GO.Option1Button", "text", "Restart")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.Show("GO.GO.Option1Button")
|
BTC.Hide("GO.HINTS.SitDownHint")
|
||||||
BTC.Run("NamedEventTrigger.GO.Option1Button")
|
BTC.Hide("GO.HINTS.StandUpHint")
|
||||||
BTC.Hide("GO.GO.Option1Button")
|
}
|
||||||
BTC.Hide("GO.GO.SpeechButton")
|
|
||||||
BTC.Hide("GO.GO.SpeechOptions")
|
Composite(Selector) {
|
||||||
|
Composite(Sequence) {
|
||||||
|
BTC.CompareSpeechError("Rate limit is exceeded")
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Hold on")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Der SpeechService ist momentan nicht\nverfügbar. In 30 Sekunden geht es weiter.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
BTC.Wait(30)
|
||||||
|
}
|
||||||
|
|
||||||
|
Composite(Sequence) {
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Fehler")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Es besteht ein Problem mit der Internetverbindung.\nBringe das VR Headset bitte zu deiner Lehrperson.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
|
||||||
|
Decorator(Repeat) {
|
||||||
|
BTC.Wait(60)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,13 +23,35 @@
|
|||||||
BTC.StopSpeechIntentRecognition()
|
BTC.StopSpeechIntentRecognition()
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
|
|
||||||
BTC.Show("GO.GO.SpeechButton")
|
Composite(Marathon) {
|
||||||
BTC.Set("TextMeshPro.GO.Option1Button", "text", "Restart")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.Show("GO.GO.Option1Button")
|
BTC.Hide("GO.HINTS.SitDownHint")
|
||||||
BTC.Run("NamedEventTrigger.GO.Option1Button")
|
BTC.Hide("GO.HINTS.StandUpHint")
|
||||||
BTC.Hide("GO.GO.Option1Button")
|
}
|
||||||
BTC.Hide("GO.GO.SpeechButton")
|
|
||||||
BTC.Hide("GO.GO.SpeechOptions")
|
Composite(Selector) {
|
||||||
|
Composite(Sequence) {
|
||||||
|
BTC.CompareSpeechError("Rate limit is exceeded")
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Hold on")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Der SpeechService ist momentan nicht\nverfügbar. In 30 Sekunden geht es weiter.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
BTC.Wait(30)
|
||||||
|
}
|
||||||
|
|
||||||
|
Composite(Sequence) {
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Fehler")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Es besteht ein Problem mit der Internetverbindung.\nBringe das VR Headset bitte zu deiner Lehrperson.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
|
||||||
|
Decorator(Repeat) {
|
||||||
|
BTC.Wait(60)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,13 +21,35 @@
|
|||||||
BTC.StopSpeechIntentRecognition()
|
BTC.StopSpeechIntentRecognition()
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
|
|
||||||
BTC.Show("GO.HANDMENU.SpeechButton")
|
Composite(Marathon) {
|
||||||
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Restart")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.Show("GO.HANDMENU.Option1Button")
|
BTC.Hide("GO.HINTS.SitDownHint")
|
||||||
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
|
BTC.Hide("GO.HINTS.StandUpHint")
|
||||||
BTC.Hide("GO.HANDMENU.Option1Button")
|
}
|
||||||
BTC.Hide("GO.HANDMENU.SpeechButton")
|
|
||||||
BTC.Hide("GO.HANDMENU.SpeechOptions")
|
Composite(Selector) {
|
||||||
|
Composite(Sequence) {
|
||||||
|
BTC.CompareSpeechError("Rate limit is exceeded")
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Hold on")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Der SpeechService ist momentan nicht\nverfügbar. In 30 Sekunden geht es weiter.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
BTC.Wait(30)
|
||||||
|
}
|
||||||
|
|
||||||
|
Composite(Sequence) {
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Fehler")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Es besteht ein Problem mit der Internetverbindung.\nBringe das VR Headset bitte zu deiner Lehrperson.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
|
||||||
|
Decorator(Repeat) {
|
||||||
|
BTC.Wait(60)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,13 +43,35 @@
|
|||||||
BTC.StopSpeechIntentRecognition()
|
BTC.StopSpeechIntentRecognition()
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
|
|
||||||
BTC.Show("GO.GO.SpeechButton")
|
Composite(Marathon) {
|
||||||
BTC.Set("TextMeshPro.GO.Option1Button", "text", "Restart")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.Show("GO.GO.Option1Button")
|
BTC.Hide("GO.HINTS.SitDownHint")
|
||||||
BTC.Run("NamedEventTrigger.GO.Option1Button")
|
BTC.Hide("GO.HINTS.StandUpHint")
|
||||||
BTC.Hide("GO.GO.Option1Button")
|
}
|
||||||
BTC.Hide("GO.GO.SpeechButton")
|
|
||||||
BTC.Hide("GO.GO.SpeechOptions")
|
Composite(Selector) {
|
||||||
|
Composite(Sequence) {
|
||||||
|
BTC.CompareSpeechError("Rate limit is exceeded")
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Hold on")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Der SpeechService ist momentan nicht\nverfügbar. In 30 Sekunden geht es weiter.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
BTC.Wait(30)
|
||||||
|
}
|
||||||
|
|
||||||
|
Composite(Sequence) {
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Fehler")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Es besteht ein Problem mit der Internetverbindung.\nBringe das VR Headset bitte zu deiner Lehrperson.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
|
||||||
|
Decorator(Repeat) {
|
||||||
|
BTC.Wait(60)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,13 +30,35 @@
|
|||||||
BTC.StopSpeechIntentRecognition()
|
BTC.StopSpeechIntentRecognition()
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
|
|
||||||
BTC.Show("GO.GO.SpeechButton")
|
Composite(Marathon) {
|
||||||
BTC.Set("TextMeshPro.GO.Option1Button", "text", "Restart")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.Show("GO.GO.Option1Button")
|
BTC.Hide("GO.HINTS.SitDownHint")
|
||||||
BTC.Run("NamedEventTrigger.GO.Option1Button")
|
BTC.Hide("GO.HINTS.StandUpHint")
|
||||||
BTC.Hide("GO.GO.Option1Button")
|
}
|
||||||
BTC.Hide("GO.GO.SpeechButton")
|
|
||||||
BTC.Hide("GO.GO.SpeechOptions")
|
Composite(Selector) {
|
||||||
|
Composite(Sequence) {
|
||||||
|
BTC.CompareSpeechError("Rate limit is exceeded")
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Hold on")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Der SpeechService ist momentan nicht\nverfügbar. In 30 Sekunden geht es weiter.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
BTC.Wait(30)
|
||||||
|
}
|
||||||
|
|
||||||
|
Composite(Sequence) {
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Fehler")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Es besteht ein Problem mit der Internetverbindung.\nBringe das VR Headset bitte zu deiner Lehrperson.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
|
||||||
|
Decorator(Repeat) {
|
||||||
|
BTC.Wait(60)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,13 +23,35 @@
|
|||||||
BTC.StopSpeechIntentRecognition()
|
BTC.StopSpeechIntentRecognition()
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
|
|
||||||
BTC.Show("GO.GO.SpeechButton")
|
Composite(Marathon) {
|
||||||
BTC.Set("TextMeshPro.GO.Option1Button", "text", "Restart")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.Show("GO.GO.Option1Button")
|
BTC.Hide("GO.HINTS.SitDownHint")
|
||||||
BTC.Run("NamedEventTrigger.GO.Option1Button")
|
BTC.Hide("GO.HINTS.StandUpHint")
|
||||||
BTC.Hide("GO.GO.Option1Button")
|
}
|
||||||
BTC.Hide("GO.GO.SpeechButton")
|
|
||||||
BTC.Hide("GO.GO.SpeechOptions")
|
Composite(Selector) {
|
||||||
|
Composite(Sequence) {
|
||||||
|
BTC.CompareSpeechError("Rate limit is exceeded")
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Hold on")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Der SpeechService ist momentan nicht\nverfügbar. In 30 Sekunden geht es weiter.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
BTC.Wait(30)
|
||||||
|
}
|
||||||
|
|
||||||
|
Composite(Sequence) {
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Fehler")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Es besteht ein Problem mit der Internetverbindung.\nBringe das VR Headset bitte zu deiner Lehrperson.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
|
||||||
|
Decorator(Repeat) {
|
||||||
|
BTC.Wait(60)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,13 +23,35 @@
|
|||||||
BTC.StopSpeechIntentRecognition()
|
BTC.StopSpeechIntentRecognition()
|
||||||
BTC.ClearPossbileSpeechIntents()
|
BTC.ClearPossbileSpeechIntents()
|
||||||
|
|
||||||
BTC.Show("GO.HANDMENU.SpeechButton")
|
Composite(Marathon) {
|
||||||
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Restart")
|
BTC.Hide("GO.HINTS.SpeakHint")
|
||||||
BTC.Show("GO.HANDMENU.Option1Button")
|
BTC.Hide("GO.HINTS.SitDownHint")
|
||||||
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
|
BTC.Hide("GO.HINTS.StandUpHint")
|
||||||
BTC.Hide("GO.HANDMENU.Option1Button")
|
}
|
||||||
BTC.Hide("GO.HANDMENU.SpeechButton")
|
|
||||||
BTC.Hide("GO.HANDMENU.SpeechOptions")
|
Composite(Selector) {
|
||||||
|
Composite(Sequence) {
|
||||||
|
BTC.CompareSpeechError("Rate limit is exceeded")
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Hold on")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Der SpeechService ist momentan nicht\nverfügbar. In 30 Sekunden geht es weiter.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
BTC.Wait(30)
|
||||||
|
}
|
||||||
|
|
||||||
|
Composite(Sequence) {
|
||||||
|
Composite(Marathon) {
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Fehler")
|
||||||
|
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Es besteht ein Problem mit der Internetverbindung.\nBringe das VR Headset bitte zu deiner Lehrperson.")
|
||||||
|
BTC.Show("GO.HINTS.SpeechErrorHint")
|
||||||
|
}
|
||||||
|
|
||||||
|
Decorator(Repeat) {
|
||||||
|
BTC.Wait(60)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@ using UnityEngine;
|
|||||||
using UnityEngine.Video;
|
using UnityEngine.Video;
|
||||||
using MyBT;
|
using MyBT;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System;
|
||||||
|
|
||||||
#if FMOD_AVAILABLE
|
#if FMOD_AVAILABLE
|
||||||
using FMODUnity;
|
using FMODUnity;
|
||||||
@ -18,6 +20,7 @@ using FMODUnity;
|
|||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEditor.SceneManagement;
|
using UnityEditor.SceneManagement;
|
||||||
|
|
||||||
[CustomEditor(typeof(BTC))]
|
[CustomEditor(typeof(BTC))]
|
||||||
public class BehaviourTreeControllerInspector : Editor {
|
public class BehaviourTreeControllerInspector : Editor {
|
||||||
public override void OnInspectorGUI() {
|
public override void OnInspectorGUI() {
|
||||||
@ -1065,12 +1068,47 @@ public class BTC : MonoBehaviour {
|
|||||||
{
|
{
|
||||||
if (_onErrorEventTriggered)
|
if (_onErrorEventTriggered)
|
||||||
{
|
{
|
||||||
Task.SetSucceeded();
|
WriteErrorToLog(_speechErrorText);
|
||||||
Debug.Log($"ERROR: Speech Service not working. Reason: {_speechErrorText}");
|
|
||||||
_onErrorEventTriggered = false;
|
_onErrorEventTriggered = false;
|
||||||
|
Task.SetSucceeded();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Task]
|
||||||
|
public void CompareSpeechError(string text)
|
||||||
|
{
|
||||||
|
if (Task.getState == NodeState.FirstRun)
|
||||||
|
{
|
||||||
|
if (_speechErrorText.Contains(text))
|
||||||
|
{
|
||||||
|
Task.SetSucceeded();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Task.SetFailed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void WriteErrorToLog(string errorText)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string logFilePath = Path.Combine(Application.persistentDataPath, "speech_errors.log");
|
||||||
|
string timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
// Format log entry
|
||||||
|
string logEntry = $"[{timestamp}] ERROR: {errorText}";
|
||||||
|
File.AppendAllText(logFilePath, logEntry + Environment.NewLine);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.LogError($"Failed to write error to log file: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Visited Stories Manager
|
#region Visited Stories Manager
|
||||||
|
@ -58,6 +58,7 @@ public class NamedTextMeshPro : ComponentHandler {
|
|||||||
public override void Set(NodeState nodeState, string key, string value) {
|
public override void Set(NodeState nodeState, string key, string value) {
|
||||||
if (nodeState == NodeState.FirstRun) {
|
if (nodeState == NodeState.FirstRun) {
|
||||||
if (key == "text") {
|
if (key == "text") {
|
||||||
|
value = value.Replace("\\n", "\n");
|
||||||
if (textMeshProUGuiComponent!=null)
|
if (textMeshProUGuiComponent!=null)
|
||||||
textMeshProUGuiComponent.text = value;
|
textMeshProUGuiComponent.text = value;
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2791925709092458573, guid: 533729b907ee1354f8dc3bca4ad67ab5, type: 3}
|
- target: {fileID: 2791925709092458573, guid: 533729b907ee1354f8dc3bca4ad67ab5, type: 3}
|
||||||
propertyPath: m_Enabled
|
propertyPath: m_Enabled
|
||||||
value: 0
|
value: 1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2855770860446126157, guid: 533729b907ee1354f8dc3bca4ad67ab5, type: 3}
|
- target: {fileID: 2855770860446126157, guid: 533729b907ee1354f8dc3bca4ad67ab5, type: 3}
|
||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user