Tree("Root") { Composite(Sequence) { BTC.InitializeSpeechManager() Composite(Race) { Composite(Sequence) { // Error in Speech Service: Cancel BTC Trees BTC.SpeechErrorOccured() BTC.SetBool("error") } Composite(Sequence) { BTC.SetVoiceName("de-DE-SeraphinaMultilingualNeural") BTC.FadeIn("FadeScene.XRInteractionHandsSetup.Black") RunTree("05_Tutorial") } } Composite(Sequence) { BTC.CompareBool("error") // Error Handling BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() BTC.Show("GO.HANDMENU.SpeechButton") BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Restart") BTC.Show("GO.HANDMENU.Option1Button") BTC.Run("NamedEventTrigger.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.SpeechButton") BTC.Hide("GO.HANDMENU.SpeechOptions") } } } Tree("05_Tutorial") { // --- Zugabteil - Tutorial --- Composite(Sequence) { BTC.SynthesizeText("Willkommen auf unserer Reise in die italienischsprachige Schweiz! Bevor wir loslegen, lass uns ein paar Dinge ausprobieren.") BTC.SpeechOutputEnded() BTC.SynthesizeText("Falls dir zu irgendeinem Zeitpunkt unwohl wird, schliesse die Augen und setze die VR-Brille ab.") BTC.SpeechOutputEnded() BTC.SynthesizeText("Vergewissere dich, dass Du sicher und bequem sitzt. Es wird Teile in der App geben, wo Du auch stehst. Für den Anfang kannst Du sitzen.") BTC.SpeechOutputEnded() BTC.SynthesizeText("Schau dich um. Beweg deinen Kopf, um die Umgebung zu entdecken.") BTC.SpeechOutputEnded() BTC.DetectRotationAtLeast("GO.XRInteractionHandsSetup.MainCamera", 30.0) BTC.Wait(3) BTC.SynthesizeText("Super! Lehne dich nun mit deinem Oberkörper nach vorne.") BTC.SpeechOutputEnded() BTC.DetectPositionAtLeast("GO.XRInteractionHandsSetup.MainCamera", 0.2) BTC.SynthesizeText("Gut so!") BTC.SpeechOutputEnded() BTC.Wait(2) BTC.SynthesizeText("Du steuerst alles per Sprache.") BTC.SpeechOutputEnded() BTC.SynthesizeText("Gut, jetzt testen wir aber mal dein Mikrofon. Wie heisst du eigentlich?") BTC.SpeechOutputEnded() BTC.Show("GO.ANIMATIONS.SpeechHint") BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-8") BTC.StartSpeechIntentRecognition() Composite(Race) { // -- Race 1: User sagt etwas Composite(Sequence) { BTC.UserStartedSpeechInput() Composite(Selector) { // -- Selector 1: Intent erkannt Composite(Sequence) { BTC.SpeechIntentRecognized() BTC.ClearPossbileSpeechIntents() } // -- Selector 2: Intent nicht erkannt Composite(Sequence) { BTC.ClearPossbileSpeechIntents() } } BTC.Hide("GO.ANIMATIONS.SpeechHint") BTC.SynthesizeText("Schön dich kennenzulernen!") BTC.SpeechOutputEnded() } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.Hide("GO.ANIMATIONS.SpeechHint") BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.SynthesizeText("Ich habe dich nicht verstanden. Sprich bitte deutlicher.") BTC.SpeechOutputEnded() BTC.Show("GO.ANIMATIONS.SpeechHint") BTC.StartSpeechIntentRecognition() Composite(Race) { // -- Race 1: User sagt etwas Composite(Sequence) { BTC.UserStartedSpeechInput() Composite(Selector) { // -- Selector 1: Intent erkannt Composite(Sequence) { BTC.SpeechIntentRecognized() BTC.ClearPossbileSpeechIntents() } // -- Selector 2: Intent nicht erkannt Composite(Sequence) { BTC.ClearPossbileSpeechIntents() } } BTC.Hide("GO.ANIMATIONS.SpeechHint") BTC.SynthesizeText("Schön dich kennenzulernen!") BTC.SpeechOutputEnded() } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(10) BTC.CompareUserSpeechInputStarted(false) BTC.Hide("GO.ANIMATIONS.SpeechHint") BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() BTC.SynthesizeText("Schön dich kennenzulernen!") BTC.SpeechOutputEnded() } } } } BTC.SynthesizeText("Ab jetzt werden wir dir Fragen nur noch auf Italienisch stellen und Du musst auch auf Italienisch antworten. Aber keine Sorge, Du wirst nicht bewertet. Du darfst einfach ausprobieren ohne Angst vor Fehlern.") BTC.SpeechOutputEnded() BTC.SynthesizeText("Zusätzlich hast Du in deiner Hand ein Smartphone. Siehst Du es? Es kann dir bei Antworten helfen, wenn Du nicht weiter weisst. Und Du kannst damit auch die Übungen wechseln (und das Programm beenden).") BTC.SpeechOutputEnded() BTC.SynthesizeText("Also jetzt geht es los. Bereit?") BTC.SpeechOutputEnded() BTC.SetSpeechRecognitionLanguage("it-IT") BTC.SetVoiceName("it-IT-FabiolaNeural") BTC.SynthesizeText("Cosa ti piace di più? Spaghetti, pizza o risotto?") BTC.SpeechOutputEnded() BTC.SetSpeechRecognitionLanguage("de-DE") BTC.SetVoiceName("de-DE-SeraphinaMultilingualNeural") BTC.Show("GO.ANIMATIONS.SpeechHint") BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-15") BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-16") BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-17") BTC.StartSpeechIntentRecognition() Composite(Race) { // -- Race 1: User sagt etwas Composite(Sequence) { BTC.UserStartedSpeechInput() Composite(Selector) { // -- Selector 1: Intent erkannt Composite(Sequence) { BTC.SpeechIntentRecognized() // Intent erkannt Composite(Race) { Composite(Sequence) { BTC.CompareIntentID("Zugabteil-Tutorial-U-15") BTC.ClearPossbileSpeechIntents() BTC.Hide("GO.ANIMATIONS.SpeechHint") BTC.SynthesizeText("Ah, Spaghetti mag ich auch!") BTC.SpeechOutputEnded() } Composite(Sequence) { BTC.CompareIntentID("Zugabteil-Tutorial-U-16") BTC.ClearPossbileSpeechIntents() BTC.Hide("GO.ANIMATIONS.SpeechHint") BTC.SynthesizeText("Ah, Pizza mag ich auch!") BTC.SpeechOutputEnded() } Composite(Sequence) { BTC.CompareIntentID("Zugabteil-Tutorial-U-17") BTC.ClearPossbileSpeechIntents() BTC.Hide("GO.ANIMATIONS.SpeechHint") BTC.SynthesizeText("Ah, Risotto mag ich auch!") BTC.SpeechOutputEnded() } } } // Selector 2: Fallback Button Composite(Sequence) { Composite(Marathon) { BTC.Hide("GO.ANIMATIONS.SpeechHint") BTC.Show("GO.HANDMENU.SpeechButton") BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Spaghetti") BTC.Show("GO.HANDMENU.Option1Button") BTC.Set("TextMeshPro.HANDMENU.Option2Button", "text", "Pizza") BTC.Show("GO.HANDMENU.Option2Button") BTC.Set("TextMeshPro.HANDMENU.Option3Button", "text", "Risotto") BTC.Show("GO.HANDMENU.Option3Button") } Composite(Race) { Composite(Sequence) { // Spaghetti BTC.Run("NamedEventTrigger.HANDMENU.Option1Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option2Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option3Button") BTC.Hide("GO.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option2Button") BTC.Hide("GO.HANDMENU.Option3Button") BTC.Hide("GO.HANDMENU.SpeechButton") BTC.Hide("GO.HANDMENU.SpeechOptions") BTC.SynthesizeText("Ah, Spaghetti mag ich auch!") BTC.SpeechOutputEnded() } Composite(Sequence) { // Pizza BTC.Run("NamedEventTrigger.HANDMENU.Option2Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option3Button") BTC.Hide("GO.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option2Button") BTC.Hide("GO.HANDMENU.Option3Button") BTC.Hide("GO.HANDMENU.SpeechButton") BTC.Hide("GO.HANDMENU.SpeechOptions") BTC.SynthesizeText("Ah, Pizza mag ich auch!") BTC.SpeechOutputEnded() } Composite(Sequence) { // Risotto BTC.Run("NamedEventTrigger.HANDMENU.Option3Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option2Button") BTC.Hide("GO.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option2Button") BTC.Hide("GO.HANDMENU.Option3Button") BTC.Hide("GO.HANDMENU.SpeechButton") BTC.Hide("GO.HANDMENU.SpeechOptions") BTC.SynthesizeText("Ah, Risotto mag ich auch!") BTC.SpeechOutputEnded() } } BTC.ClearPossbileSpeechIntents() } } } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.Hide("GO.ANIMATIONS.SpeechHint") BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() Composite(Sequence) { Composite(Marathon) { BTC.Show("GO.HANDMENU.SpeechButton") BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Spaghetti") BTC.Show("GO.HANDMENU.Option1Button") BTC.Set("TextMeshPro.HANDMENU.Option2Button", "text", "Pizza") BTC.Show("GO.HANDMENU.Option2Button") BTC.Set("TextMeshPro.HANDMENU.Option3Button", "text", "Risotto") BTC.Show("GO.HANDMENU.Option3Button") } Composite(Race) { Composite(Sequence) { // Spaghetti BTC.Run("NamedEventTrigger.HANDMENU.Option1Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option2Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option3Button") BTC.Hide("GO.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option2Button") BTC.Hide("GO.HANDMENU.Option3Button") BTC.Hide("GO.HANDMENU.SpeechButton") BTC.Hide("GO.HANDMENU.SpeechOptions") BTC.SynthesizeText("Ah, Spaghetti mag ich auch!") BTC.SpeechOutputEnded() } Composite(Sequence) { // Pizza BTC.Run("NamedEventTrigger.HANDMENU.Option2Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option3Button") BTC.Hide("GO.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option2Button") BTC.Hide("GO.HANDMENU.Option3Button") BTC.Hide("GO.HANDMENU.SpeechButton") BTC.Hide("GO.HANDMENU.SpeechOptions") BTC.SynthesizeText("Ah, Pizza mag ich auch!") BTC.SpeechOutputEnded() } Composite(Sequence) { // Risotto BTC.Run("NamedEventTrigger.HANDMENU.Option3Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option2Button") BTC.Hide("GO.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option2Button") BTC.Hide("GO.HANDMENU.Option3Button") BTC.Hide("GO.HANDMENU.SpeechButton") BTC.Hide("GO.HANDMENU.SpeechOptions") BTC.SynthesizeText("Ah, Risotto mag ich auch!") BTC.SpeechOutputEnded() } } BTC.ClearPossbileSpeechIntents() } } } BTC.SynthesizeText("Okay. Versuche, deinen Rucksack vom Tisch hochzuheben. Strecke dazu deine Hand aus und greife nach dem Rucksack, wie Du es auch sonst tun würdest.") BTC.SpeechOutputEnded() BTC.Show("GO.ANIMATIONS.PinchingHint") // Rucksack greifen BTC.Run("NamedGrabEvent.INTERACTABLES.Rucksack") BTC.SynthesizeText("Stelle den Rucksack nun auf die markierte Stelle auf den Sitz rechts von Dir.") BTC.SpeechOutputEnded() // Rucksack ins Socket BTC.Show("GO/NamedSocketEvent.SOCKETS.RucksackUser") BTC.Run("GO/NamedSocketEvent.SOCKETS.RucksackUser") BTC.Wait(1) BTC.Hide("GO/NamedSocketEvent.SOCKETS.RucksackUser") BTC.Hide("GO.ANIMATIONS.PinchingHint") BTC.SynthesizeText("Perfekt! Du hast gelernt dich zu bewegen, zu sprechen und mit Objekten zu interagieren. Dann geht es jetzt los!") BTC.SpeechOutputEnded() BTC.SetSpeechRecognitionLanguage("it-IT") BTC.SetVoiceName("it-IT-FabiolaNeural") BTC.SynthesizeText("Allora, siamo pronti. La tua compagna di viaggio è Francesca. Arriverà presto. Buon viaggio!") BTC.SpeechOutputEnded() BTC.FadeOut("FadeScene.XRInteractionHandsSetup.Black") BTC.Run("LoadScene.NEXT.10SBB") } }