Tree("Root") { Composite(Sequence) { BTC.InitializeSpeechManager() BTC.SetSpeechRecognitionLanguage("it-IT") BTC.SetVoiceName("it-IT-FabiolaNeural") Composite(Race) { Composite(Sequence) { // Error in Speech Service: Cancel BTC Trees BTC.SpeechErrorOccured() BTC.SetBool("error") } Composite(Sequence) { //RunTree("22_Geschaeft_Story_A_Picknicken_Intro") RunTree("22_Geschaeft_Baeckerei_Outro") } } 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.Show("GO.HANDMENU.Home") BTC.Hide("GO.HANDMENU.SpeechOptions") } } } Tree("22_Geschaeft_Story_A_Picknicken_Intro") { Composite(Sequence) { BTC.Show("Depthkit.VIDEOS.Intro1StoryAPickni") BTC.Run("Depthkit.VIDEOS.Intro1StoryAPickni") BTC.Hide("Depthkit.VIDEOS.Intro1StoryAPickni") BTC.Show("Depthkit.VIDEOS.Intro2StoryAPickni") BTC.Run("Depthkit.VIDEOS.Intro2StoryAPickni") BTC.Hide("Depthkit.VIDEOS.Intro2StoryAPickni") BTC.AddPossbileSpeechIntent("Story_A_Picknicken.Intro.3") 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() } } RunTree("22_Geschaeft_Story_A_Picknicken_Mitnehmen") } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() // --- Story A Picknicken - Nachfrage Bestellung --- BTC.Show("Depthkit.VIDEOS.NachfrageBestellun_01") BTC.Run("Depthkit.VIDEOS.NachfrageBestellun_01") BTC.Hide("Depthkit.VIDEOS.NachfrageBestellun_01") BTC.AddPossbileSpeechIntent("Story_A_Picknicken.Nachfrage_Bestellung.2") 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() } } RunTree("22_Geschaeft_Story_A_Picknicken_Mitnehmen") } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() // --- Story A Picknicken - Bestellung Begleiter Beide --- BTC.Show("Depthkit.VIDEOS.BestellungBegleite_Beide01") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_Beide01") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_Beide01") BTC.Show("Depthkit.VIDEOS.BestellungBegleite_Beide02") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_Beide02") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_Beide02") BTC.Show("Depthkit.VIDEOS.BestellungBegleite_Beide03") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_Beide03") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_Beide03") BTC.Show("Depthkit.VIDEOS.BestellungBegleite_Beide04") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_Beide04") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_Beide04") BTC.Show("Depthkit.VIDEOS.BestellungBegleite_Beide05") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_Beide05") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_Beide05") BTC.Show("Depthkit.VIDEOS.BestellungBegleite_Beide07") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_Beide07") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_Beide07") BTC.Show("Depthkit.VIDEOS.BestellungBegleite_Beide06") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_Beide06") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_Beide06") RunTree("22_Geschaeft_Baeckerei_Outro") } } } // erste Race user sagt nichts } // erste grosse race } } Tree("22_Geschaeft_Story_A_Picknicken_Mitnehmen") { // --- Story A Picknicken - Mitnehmen --- Composite(Sequence) { BTC.Show("Depthkit.VIDEOS.Mitnehmen1StoryAPi") BTC.Run("Depthkit.VIDEOS.Mitnehmen1StoryAPi") BTC.Hide("Depthkit.VIDEOS.Mitnehmen1StoryAPi") BTC.AddPossbileSpeechIntent("Story_A_Picknicken.Mitnehmen.2") 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() } } } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() } } BTC.Show("Depthkit.VIDEOS.Mitnehmen5StoryAPi") BTC.Run("Depthkit.VIDEOS.Mitnehmen5StoryAPi") BTC.Hide("Depthkit.VIDEOS.Mitnehmen5StoryAPi") // --- Story A Picknicken - Bezahlen einzeln --- BTC.Show("Depthkit.VIDEOS.Bezahleneinzeln1St") BTC.Run("Depthkit.VIDEOS.Bezahleneinzeln1St") BTC.Hide("Depthkit.VIDEOS.Bezahleneinzeln1St") // ToDo: Bezahlung mit Handy User Composite(Race) { // ToDo: Collide handy mit Payment device BTC.GetKeyDown("Return") Composite(Sequence) { BTC.Wait(5) // Collide Aktion abbrechen? // --- Story A Picknicken - Nachfrage Bezahlung --- BTC.Show("Depthkit.VIDEOS.NachfrageBezahlung_01") BTC.Run("Depthkit.VIDEOS.NachfrageBezahlung_01") BTC.Hide("Depthkit.VIDEOS.NachfrageBezahlung_01") Composite(Race) { // ToDo: Collide handy mit Payment device BTC.GetKeyDown("Return") Composite(Sequence) { BTC.Wait(5) // Collide aktion abbrechen? BTC.Show("Depthkit.VIDEOS.NachfrageBezahlung_03") BTC.Run("Depthkit.VIDEOS.NachfrageBezahlung_03") BTC.Hide("Depthkit.VIDEOS.NachfrageBezahlung_03") } } } } // --- Story A Picknicken - Dank Einkauf --- BTC.Show("Depthkit.VIDEOS.DankEinkauf1StoryA") BTC.Run("Depthkit.VIDEOS.DankEinkauf1StoryA") BTC.Hide("Depthkit.VIDEOS.DankEinkauf1StoryA") BTC.AddPossbileSpeechIntent("Story_A_Picknicken.Dank_Einkauf.2") 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() } } } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() } } // --- Story A Picknicken - Bestellung Begleiter --- BTC.Show("Depthkit.VIDEOS.BestellungBegleite_01") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_01") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_01") BTC.Show("Depthkit.VIDEOS.BestellungBegleite_02") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_02") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_02") BTC.Show("Depthkit.VIDEOS.BestellungBegleite_03") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_03") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_03") BTC.Show("Depthkit.VIDEOS.BestellungBegleite_04") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_04") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_04") BTC.Show("Depthkit.VIDEOS.BestellungBegleite_05") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_05") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_05") BTC.Show("Depthkit.VIDEOS.BestellungBegleite_06") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_06") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_06") BTC.Show("Depthkit.VIDEOS.BestellungBegleite_08") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_08") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_08") BTC.Show("Depthkit.VIDEOS.BestellungBegleite_09") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_09") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_09") BTC.Show("Depthkit.VIDEOS.BestellungBegleite_10") BTC.Run("Depthkit.VIDEOS.BestellungBegleite_10") BTC.Hide("Depthkit.VIDEOS.BestellungBegleite_10") RunTree("22_Geschaeft_Baeckerei_Outro") } } Tree("22_Geschaeft_Baeckerei_Outro") { // --- Baeckerei Outro --- Composite(Sequence) { Composite(Marathon) { BTC.SetPosition("GO.XRInteractionHandsSetup.XROrigin", -2.827, 0, 0.996) BTC.SetPosition("GO.HANDMENU", -2.827, 0, 0.996) BTC.RotateToAngle("GO.XRInteractionHandsSetup.XROrigin", 0.0) BTC.RotateToAngle("GO.HANDMENU", 0.0) } BTC.Show("Depthkit.VIDEOS.0BaeckereiOutro") Composite(Marathon) { BTC.Run("Depthkit.VIDEOS.0BaeckereiOutro") BTC.Run("StudioEventEmitter.STATIC.TuerOeffnenSound") } BTC.Hide("Depthkit.VIDEOS.0BaeckereiOutro") BTC.Show("Depthkit.VIDEOS.1BaeckereiOutro") BTC.Run("Depthkit.VIDEOS.1BaeckereiOutro") BTC.Hide("Depthkit.VIDEOS.1BaeckereiOutro") BTC.SetVoiceName("it-IT-GiuseppeMultilingualNeural") BTC.SynthesizeText("Ciao Francesca, ti ho visto da fuori. Che piacere vederti!") BTC.SpeechOutputEnded() BTC.SynthesizeText("Vedo che avete grandi progetti per oggi!") BTC.SpeechOutputEnded() BTC.SetVoiceName("it-IT-FabiolaNeural") BTC.SynthesizeText("Ti presento qualcuno, è di passaggio e viene dalla Svizzera tedesca.") BTC.SpeechOutputEnded() BTC.SetVoiceName("it-IT-GiuseppeMultilingualNeural") BTC.SynthesizeText("Ciao, piacere di conoscerti. Sono Enrico. Come ti chiami?") BTC.SpeechOutputEnded() BTC.AddPossbileSpeechIntent("Baeckerei_Outro.6") 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() } } } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() } } BTC.SetVoiceName("it-IT-FabiolaNeural") BTC.SynthesizeText("Stiamo andando a fare un picnic. Perché non vieni con noi?") BTC.SpeechOutputEnded() BTC.SetVoiceName("it-IT-GiuseppeMultilingualNeural") BTC.SynthesizeText("Mi piacerebbe, ma sto andando ad allenarmi.") BTC.SpeechOutputEnded() BTC.SetVoiceName("it-IT-FabiolaNeural") BTC.SynthesizeText("Ah, ok, io tornerò la settimana prossima.") BTC.SpeechOutputEnded() BTC.SetVoiceName("it-IT-GiuseppeMultilingualNeural") BTC.SynthesizeText("Be’, allora divertitevi! Ehi, è stato bello vederti!") BTC.SpeechOutputEnded() BTC.SetVoiceName("it-IT-FabiolaNeural") BTC.SynthesizeText("Anche per me, ciao Enrico!") BTC.SpeechOutputEnded() BTC.SynthesizeText("È un mio amico. Ci siamo conosciuti frequentando il gruppo di arrampicata. Davvero un grande amico! Dai, ora cerchiamo un bel posticino per rilassarci un po’. Andiamo a piedi o preferisci andare in monopattino? Non è lontano, sai. Da qui, a piedi impieghiamo una ventina di minuti.") BTC.SpeechOutputEnded() BTC.AddPossbileSpeechIntent("Baeckerei_Outro.16") BTC.AddPossbileSpeechIntent("Baeckerei_Outro.18") BTC.StartSpeechIntentRecognition() Composite(Race) { // -- Race 1: User sagt etwas Composite(Sequence) { BTC.UserStartedSpeechInput() Composite(Selector) { // -- Selector 1: Intent erkannt Composite(Sequence) { BTC.SpeechIntentRecognized() Composite(Race) { Composite(Sequence) { BTC.CompareIntentID("Baeckerei_Outro.16") BTC.SetBool("ChoosedWalking") } Composite(Sequence) { BTC.CompareIntentID("Baeckerei_Outro.18") BTC.SetBool("ChoosedDriving") } } BTC.ClearPossbileSpeechIntents() } // -- Selector 2: Intent nicht erkannt Composite(Sequence) { BTC.SynthesizeText("Allora, in monopattino o a piedi?") BTC.SpeechOutputEnded() BTC.StartSpeechIntentRecognition() Composite(Race) { Composite(Sequence) { BTC.UserStartedSpeechInput() BTC.SpeechIntentRecognized() Composite(Race) { Composite(Sequence) { BTC.CompareIntentID("Baeckerei_Outro.16") BTC.SetBool("ChoosedWalking") } Composite(Sequence) { BTC.CompareIntentID("Baeckerei_Outro.18") BTC.SetBool("ChoosedDriving") } } BTC.ClearPossbileSpeechIntents() } Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() BTC.CompareUserSpeechInputStarted(true) } } } // Selector 3: Fallback Button Composite(Sequence) { Composite(Marathon) { BTC.Show("GO.HANDMENU.SpeechOptions") BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "A piedi") BTC.Show("GO.HANDMENU.Option1Button") BTC.Set("TextMeshPro.HANDMENU.Option2Button", "text", "Monopattino") BTC.Show("GO.HANDMENU.Option2Button") } Composite(Race) { Composite(Sequence) { // Zu Fuss BTC.Run("NamedEventTrigger.HANDMENU.Option1Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option2Button") BTC.Hide("GO.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option2Button") BTC.Hide("GO.HANDMENU.SpeechButton") BTC.Show("GO.HANDMENU.Home") BTC.Hide("GO.HANDMENU.SpeechOptions") BTC.SetBool("ChoosedWalking") } Composite(Sequence) { // Scooter BTC.Run("NamedEventTrigger.HANDMENU.Option2Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option2Button") BTC.Hide("GO.HANDMENU.SpeechButton") BTC.Show("GO.HANDMENU.Home") BTC.Hide("GO.HANDMENU.SpeechOptions") BTC.SetBool("ChoosedDriving") } } } } } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() Composite(Marathon) { BTC.Show("GO.HANDMENU.SpeechButton") BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "A piedi") BTC.Show("GO.HANDMENU.Option1Button") BTC.Set("TextMeshPro.HANDMENU.Option2Button", "text", "Monopattino") BTC.Show("GO.HANDMENU.Option2Button") } Composite(Race) { Composite(Sequence) { // Zu Fuss BTC.Run("NamedEventTrigger.HANDMENU.Option1Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option2Button") BTC.Hide("GO.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option2Button") BTC.Hide("GO.HANDMENU.SpeechButton") BTC.Show("GO.HANDMENU.Home") BTC.Hide("GO.HANDMENU.SpeechOptions") BTC.SetBool("ChoosedWalking") } Composite(Sequence) { // Scooter BTC.Run("NamedEventTrigger.HANDMENU.Option2Button") BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option2Button") BTC.Hide("GO.HANDMENU.SpeechButton") BTC.Show("GO.HANDMENU.Home") BTC.Hide("GO.HANDMENU.SpeechOptions") BTC.SetBool("ChoosedDriving") } } } } BTC.SynthesizeText("Allora andiamo! Ciao Pietro.") BTC.SpeechOutputEnded() BTC.SetVoiceName("it-IT-GiuseppeMultilingualNeural") BTC.SynthesizeText("Hey Francesca, non dimenticare il vostro pranzo!") BTC.SpeechOutputEnded() BTC.SetVoiceName("it-IT-FabiolaNeural") BTC.SynthesizeText("Uh, grazie mille!") BTC.SpeechOutputEnded() BTC.SetVoiceName("it-IT-GiuseppeMultilingualNeural") BTC.SynthesizeText("Ciao Francesca, divertitevi!") BTC.SpeechOutputEnded() RunTree("22_Geschaeft_Hide") } } Tree("22_Geschaeft_Hide") { Composite(Sequence) { BTC.SetStoryAVisited() Composite(Race) { Composite(Sequence) { // Go to scene 2.4 Slideshow BTC.CompareBool("ChoosedWalking") BTC.Run("LoadScene.NEXT.24Slideshow") } Composite(Sequence) { // Go to scene 2.5 Slideshow BTC.CompareBool("ChoosedDriving") BTC.Run("LoadScene.NEXT.25Slideshow") } } } }