Tree("Root") { Composite(Sequence) { BTC.InitializeSpeechManager() BTC.SetSpeechRecognitionLanguage("it-IT") BTC.SetVoiceName("it-IT-IsabellaMultilingualNeural") Composite(Race) { Composite(Sequence) { // Error in Speech Service: Cancel BTC Trees BTC.SpeechErrorOccured() BTC.SetBool("error") } Composite(Sequence) { RunTree("26_Castello_Castelli_di_Bellinzona_Intro") //RunTree("26_Castello_Castelli_di_Bellinzona_Geschichte_Castelli") } } Composite(Sequence) { BTC.CompareBool("error") // Error Handling BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() BTC.Show("GO.GO.SpeechButton") BTC.Set("TextMeshPro.GO.Option1Button", "text", "Restart") BTC.Show("GO.GO.Option1Button") BTC.Run("NamedEventTrigger.GO.Option1Button") BTC.Hide("GO.GO.Option1Button") BTC.Hide("GO.GO.SpeechButton") BTC.Show("GO.GO.Home") BTC.Hide("GO.GO.SpeechOptions") } } } Tree("26_Castello_Castelli_di_Bellinzona_Intro") { // --- Castelli di Bellinzona - Intro --- Composite(Sequence) { BTC.Show("Depthkit.VIDEOS.Intro1CastellidiBe") BTC.Run("Depthkit.VIDEOS.Intro1CastellidiBe") BTC.Hide("Depthkit.VIDEOS.Intro1CastellidiBe") BTC.AddPossbileSpeechIntent("Castelli_di_Bellinzona.Intro.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(10) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() } } BTC.Show("Depthkit.VIDEOS.Intro5CastellidiBe") BTC.Run("Depthkit.VIDEOS.Intro5CastellidiBe") BTC.Hide("Depthkit.VIDEOS.Intro5CastellidiBe") BTC.AddPossbileSpeechIntent("Castelli_di_Bellinzona.Intro.6") BTC.AddPossbileSpeechIntent("Castelli_di_Bellinzona.Intro.7") 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("Castelli_di_Bellinzona.Intro.6") BTC.ClearPossbileSpeechIntents() // Warten bis User Foto macht BTC.Run("NamedEventTrigger.GO.CameraButton") } Composite(Sequence) { BTC.CompareIntentID("Castelli_di_Bellinzona.Intro.7") BTC.ClearPossbileSpeechIntents() } } } // -- Selector 2: Intent nicht erkannt Composite(Sequence) { BTC.ClearPossbileSpeechIntents() // Fallback Button Composite(Marathon) { BTC.Show("GO.GO.SpeechButton") BTC.Set("TextMeshPro.GO.Option1Button", "text", "Sì.") BTC.Show("GO.GO.Option1Button") BTC.Set("TextMeshPro.GO.Option2Button", "text", "No.") BTC.Show("GO.GO.Option2Button") } Composite(Race) { Composite(Sequence) { // Ja BTC.Run("NamedEventTrigger.GO.Option1Button") BTC.AbortEventListener("NamedEventTrigger.GO.Option2Button") BTC.Hide("GO.GO.Option1Button") BTC.Hide("GO.GO.Option2Button") BTC.Hide("GO.GO.SpeechButton") BTC.Show("GO.GO.Home") BTC.Hide("GO.GO.SpeechOptions") // Warten bis User Foto macht BTC.Run("NamedEventTrigger.GO.CameraButton") } Composite(Sequence) { // Nein BTC.Run("NamedEventTrigger.GO.Option2Button") BTC.AbortEventListener("NamedEventTrigger.GO.Option1Button") BTC.Hide("GO.GO.Option1Button") BTC.Hide("GO.GO.Option2Button") BTC.Hide("GO.GO.SpeechButton") BTC.Show("GO.GO.Home") BTC.Hide("GO.GO.SpeechOptions") } } } } } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(10) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() } } BTC.Show("Depthkit.VIDEOS.Intro10CastellidiB") BTC.Run("Depthkit.VIDEOS.Intro10CastellidiB") BTC.Hide("Depthkit.VIDEOS.Intro10CastellidiB") BTC.AddPossbileSpeechIntent("Castelli_di_Bellinzona.Intro.11") BTC.AddPossbileSpeechIntent("Castelli_di_Bellinzona.Intro.12") 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.Intro15CastellidiB") BTC.Run("Depthkit.VIDEOS.Intro15CastellidiB") BTC.Hide("Depthkit.VIDEOS.Intro15CastellidiB") BTC.AddPossbileSpeechIntent("Castelli_di_Bellinzona.Intro.16") BTC.AddPossbileSpeechIntent("Castelli_di_Bellinzona.Intro.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("Castelli_di_Bellinzona.Intro.16") BTC.ClearPossbileSpeechIntents() RunTree("26_Castello_Castelli_di_Bellinzona_Geschichte_Castelli") } Composite(Sequence) { BTC.CompareIntentID("Castelli_di_Bellinzona.Intro.18") BTC.ClearPossbileSpeechIntents() RunTree("26_Castello_Castelli_di_Bellinzona_KI_Audio_Chat_Castelli") } } } // -- Selector 2: Intent nicht erkannt Composite(Sequence) { BTC.ClearPossbileSpeechIntents() // Fallback Button Composite(Marathon) { BTC.Show("GO.GO.SpeechButton") BTC.Set("TextMeshPro.GO.Option1Button", "text", "Sì.") BTC.Show("GO.GO.Option1Button") BTC.Set("TextMeshPro.GO.Option2Button", "text", "No.") BTC.Show("GO.GO.Option2Button") } Composite(Race) { Composite(Sequence) { // Ja BTC.Run("NamedEventTrigger.GO.Option1Button") BTC.AbortEventListener("NamedEventTrigger.GO.Option2Button") BTC.Hide("GO.GO.Option1Button") BTC.Hide("GO.GO.Option2Button") BTC.Hide("GO.GO.SpeechButton") BTC.Show("GO.GO.Home") BTC.Hide("GO.GO.SpeechOptions") RunTree("26_Castello_Castelli_di_Bellinzona_Geschichte_Castelli") } Composite(Sequence) { // Nein BTC.Run("NamedEventTrigger.GO.Option2Button") BTC.AbortEventListener("NamedEventTrigger.GO.Option1Button") BTC.Hide("GO.GO.Option1Button") BTC.Hide("GO.GO.Option2Button") BTC.Hide("GO.GO.SpeechButton") BTC.Show("GO.GO.Home") BTC.Hide("GO.GO.SpeechOptions") RunTree("26_Castello_Castelli_di_Bellinzona_KI_Audio_Chat_Castelli") } } } } } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() RunTree("26_Castello_Castelli_di_Bellinzona_KI_Audio_Chat_Castelli") } } } } Tree("26_Castello_Castelli_di_Bellinzona_Chatbot_Init") { // Initialization Composite(Marathon) { BTC.SetPosition("GO.XRInteractionHandsSetup.XROrigin", 52.99, 0, 20.4) BTC.SetPosition("GO.HANDMENU", 52.99, 0, 20.4) BTC.RotateToAngle("GO.XRInteractionHandsSetup.XROrigin", 90.0) BTC.RotateToAngle("GO.HANDMENU", 90.0) } } Tree("26_Castello_Castelli_di_Bellinzona_Geschichte_Castelli") { // --- Castelli di Bellinzona - Geschichte Castelli --- Composite(Sequence) { RunTree("26_Castello_Castelli_di_Bellinzona_Chatbot_Init") BTC.Show("Depthkit.VIDEOS.GeschichteCastelli_01") BTC.Run("Depthkit.VIDEOS.GeschichteCastelli_01") BTC.Hide("Depthkit.VIDEOS.GeschichteCastelli_01") BTC.AddPossbileSpeechIntent("Castelli_di_Bellinzona.Geschichte_Castelli.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.GeschichteCastelli_05") BTC.Run("Depthkit.VIDEOS.GeschichteCastelli_05") BTC.Hide("Depthkit.VIDEOS.GeschichteCastelli_05") BTC.Show("Depthkit.VIDEOS.GeschichteCastelli_06") BTC.Run("Depthkit.VIDEOS.GeschichteCastelli_06") BTC.Hide("Depthkit.VIDEOS.GeschichteCastelli_06") BTC.AddPossbileSpeechIntent("Castelli_di_Bellinzona.Geschichte_Castelli.7") BTC.AddPossbileSpeechIntent("Castelli_di_Bellinzona.Geschichte_Castelli.9") 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) { // User weiss es nicht BTC.CompareIntentID("Castelli_di_Bellinzona.Geschichte_Castelli.7") BTC.ClearPossbileSpeechIntents() RunTree("26_Castello_Castelli_di_Bellinzona_Chatbot_Burgen") } Composite(Sequence) { // User weiss Antwort BTC.CompareIntentID("Castelli_di_Bellinzona.Geschichte_Castelli.9") BTC.ClearPossbileSpeechIntents() BTC.Show("Depthkit.VIDEOS.GeschichteCastelli_10") BTC.Run("Depthkit.VIDEOS.GeschichteCastelli_10") BTC.Hide("Depthkit.VIDEOS.GeschichteCastelli_10") RunTree("26_Castello_Castelli_di_Bellinzona_Geschichte_Castelli_Bot1") } } } // -- Selector 2: Intent nicht erkannt Composite(Sequence) { BTC.ClearPossbileSpeechIntents() RunTree("26_Castello_Castelli_di_Bellinzona_Chatbot_Burgen") } } } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() RunTree("26_Castello_Castelli_di_Bellinzona_Chatbot_Burgen") } } } } Tree("26_Castello_Castelli_di_Bellinzona_Chatbot_Burgen") { // --- Castelli di Bellinzona - Chatbot Burgen --- Composite(Sequence) { BTC.Show("Depthkit.VIDEOS.ChatbotBurgen1Cast") BTC.Run("Depthkit.VIDEOS.ChatbotBurgen1Cast") BTC.Hide("Depthkit.VIDEOS.ChatbotBurgen1Cast") BTC.Show("Depthkit.VIDEOS.ChatbotBurgen2Cast") BTC.Run("Depthkit.VIDEOS.ChatbotBurgen2Cast") BTC.Hide("Depthkit.VIDEOS.ChatbotBurgen2Cast") BTC.SynthesizeText("Per proteggere la città dagli attacchi nemici. Vuoi saperne di più?") BTC.SpeechOutputEnded() BTC.Show("Depthkit.VIDEOS.ChatbotBurgen4Cast") BTC.Run("Depthkit.VIDEOS.ChatbotBurgen4Cast") BTC.Hide("Depthkit.VIDEOS.ChatbotBurgen4Cast") BTC.AddPossbileSpeechIntent("Castelli_di_Bellinzona.Chatbot_Burgen.5") BTC.AddPossbileSpeechIntent("Castelli_di_Bellinzona.Chatbot_Burgen.7") 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("Castelli_di_Bellinzona.Chatbot_Burgen.5") BTC.ClearPossbileSpeechIntents() RunTree("26_Castello_Castelli_di_Bellinzona_Geschichte_Castelli_Bot") } Composite(Sequence) { BTC.CompareIntentID("Castelli_di_Bellinzona.Chatbot_Burgen.7") BTC.ClearPossbileSpeechIntents() RunTree("26_Castello_Castelli_di_Bellinzona_KI_Audio_Chat_Castelli") } } } // -- Selector 2: Intent nicht erkannt Composite(Sequence) { BTC.ClearPossbileSpeechIntents() // Fallback Button Composite(Marathon) { BTC.Show("GO.GO.SpeechButton") BTC.Set("TextMeshPro.GO.Option1Button", "text", "Sì.") BTC.Show("GO.GO.Option1Button") BTC.Set("TextMeshPro.GO.Option2Button", "text", "No.") BTC.Show("GO.GO.Option2Button") } Composite(Race) { Composite(Sequence) { // Ja BTC.Run("NamedEventTrigger.GO.Option1Button") BTC.AbortEventListener("NamedEventTrigger.GO.Option2Button") BTC.Hide("GO.GO.Option1Button") BTC.Hide("GO.GO.Option2Button") BTC.Hide("GO.GO.SpeechButton") BTC.Show("GO.GO.Home") BTC.Hide("GO.GO.SpeechOptions") RunTree("26_Castello_Castelli_di_Bellinzona_Geschichte_Castelli_Bot") } Composite(Sequence) { // Nein BTC.Run("NamedEventTrigger.GO.Option2Button") BTC.AbortEventListener("NamedEventTrigger.GO.Option1Button") BTC.Hide("GO.GO.Option1Button") BTC.Hide("GO.GO.Option2Button") BTC.Hide("GO.GO.SpeechButton") BTC.Show("GO.GO.Home") BTC.Hide("GO.GO.SpeechOptions") RunTree("26_Castello_Castelli_di_Bellinzona_KI_Audio_Chat_Castelli") } } } } } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() RunTree("26_Castello_Castelli_di_Bellinzona_Geschichte_Castelli_Bot") } } } } Tree("26_Castello_Castelli_di_Bellinzona_Geschichte_Castelli_Bot") { // --- Castelli di Bellinzona - Geschichte Castelli Bot --- Composite(Sequence) { BTC.GetKeyDown("Return") } } Tree("26_Castello_Castelli_di_Bellinzona_Geschichte_Castelli_Bot1") { // --- Castelli di Bellinzona - Geschichte Castelli Bot1 --- Composite(Sequence) { BTC.GetKeyDown("Return") } } Tree("26_Castello_Castelli_di_Bellinzona_KI_Audio_Chat_Castelli") { // --- Castelli di Bellinzona - KI Audio Chat Castelli --- Composite(Sequence) { RunTree("26_Castello_Castelli_di_Bellinzona_Chatbot_Init") } }