From c8587fdbbded61c75adc9071277d08d4bc35542e Mon Sep 17 00:00:00 2001 From: Nadine Ganz Date: Tue, 5 Aug 2025 14:14:55 +0200 Subject: [PATCH] Update Kueche_Abbruch in Grotto2+Grotto1 --- .../Assets/BehaviourTrees/3.2-Grotto1.bt.txt | 54 +++++++++++++++++-- .../Assets/BehaviourTrees/3.2-Grotto2.bt.txt | 12 ++++- Viagg-io/Assets/Packages/MyBT/BTC/BTC.cs | 32 +++++------ Viagg-io/Assets/Scripts/EntryLevel.cs | 8 ++- Viagg-io/Assets/Scripts/LevelManager.cs | 35 ------------ 5 files changed, 83 insertions(+), 58 deletions(-) diff --git a/Viagg-io/Assets/BehaviourTrees/3.2-Grotto1.bt.txt b/Viagg-io/Assets/BehaviourTrees/3.2-Grotto1.bt.txt index be31a569..3ab05e83 100644 --- a/Viagg-io/Assets/BehaviourTrees/3.2-Grotto1.bt.txt +++ b/Viagg-io/Assets/BehaviourTrees/3.2-Grotto1.bt.txt @@ -11,8 +11,47 @@ BTC.SetBool("error") } - RunTree("32_Grotto_Story_B_Grotto_Intro") - //RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto") + Composite(Selector) { + Composite(Sequence) { + // Check Abbruch Kochen + BTC.CheckEntryLevel(2) + + // Initialization + Composite(Marathon) { + BTC.SetPosition("GO.XRInteractionHandsSetup.XROrigin", -3.573, 0, -12.124) + BTC.SetPosition("GO.HANDMENU", -3.573, 0, -12.124) + BTC.RotateToAngle("GO.XRInteractionHandsSetup.XROrigin", 0.0) + BTC.RotateToAngle("GO.HANDMENU", 0.0) + BTC.Run("StudioEventEmitter.STATIC.KuechenAmbi") + BTC.Run("StudioEventEmitter.STATIC.AmbiGarten") + BTC.FadeIn("FadeScene.XRInteractionHandsSetup.Black") + } + BTC.Wait(5) + BTC.ResetEntryLevel(2) + RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto_Teil2") + } + + Composite(Sequence) { + // Check Puschlav Grotto + BTC.CheckEntryLevel(1) + + // Initialization + Composite(Marathon) { + BTC.SetPosition("GO.XRInteractionHandsSetup.XROrigin", -3.573, 0, -12.124) + BTC.SetPosition("GO.HANDMENU", -3.573, 0, -12.124) + BTC.RotateToAngle("GO.XRInteractionHandsSetup.XROrigin", 0.0) + BTC.RotateToAngle("GO.HANDMENU", 0.0) + BTC.Run("StudioEventEmitter.STATIC.KuechenAmbi") + BTC.Run("StudioEventEmitter.STATIC.AmbiGarten") + BTC.FadeIn("FadeScene.XRInteractionHandsSetup.Black") + } + BTC.Wait(5) + BTC.ResetEntryLevel(1) + RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto_Teil2") + } + + RunTree("32_Grotto_Story_B_Grotto_Intro") + } } Composite(Sequence) { @@ -503,8 +542,8 @@ Tree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto") { // Initialization Composite(Marathon) { - BTC.SetPosition("GO.XRInteractionHandsSetup.XROrigin", -3.573, 0, -12.295) - BTC.SetPosition("GO.HANDMENU", -3.573, 0, -12.295) + BTC.SetPosition("GO.XRInteractionHandsSetup.XROrigin", -3.573, 0, -12.124) + BTC.SetPosition("GO.HANDMENU", -3.573, 0, -12.124) BTC.RotateToAngle("GO.XRInteractionHandsSetup.XROrigin", 0.0) BTC.RotateToAngle("GO.HANDMENU", 0.0) BTC.Run("StudioEventEmitter.STATIC.KuechenAmbi") @@ -527,6 +566,13 @@ Tree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto") { } } + RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto_Teil2") + } +} + +Tree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto_Teil2") { +// --- Story B Grotto - Antwort Nonna Grotto Teil 2 --- + Composite(Sequence) { BTC.Run("MediaPlayer.VIDEOS.AntwortNonnaGrotto_Teil2F2") BTC.Run("MediaPlayer.VIDEOS.AntwortNonnaGrotto_Teil2Fidle03") BTC.AddPossbileSpeechIntent("Story_B_Grotto-Antwort_Nonna_Grotto_Teil2-U-3a") diff --git a/Viagg-io/Assets/BehaviourTrees/3.2-Grotto2.bt.txt b/Viagg-io/Assets/BehaviourTrees/3.2-Grotto2.bt.txt index 24657bdd..fdf0fec5 100644 --- a/Viagg-io/Assets/BehaviourTrees/3.2-Grotto2.bt.txt +++ b/Viagg-io/Assets/BehaviourTrees/3.2-Grotto2.bt.txt @@ -155,8 +155,16 @@ Tree("32_Grotto_Kueche_Intro") { Composite(Sequence) { // --- Kueche - Abbruch --- BTC.Hide("MediaPlayer.VIDEOS.ZwiebelnschneidenF_Idle02") - BTC.Run("MediaPlayer.VIDEOS.AbbruchF1") - // TODO: Define Jump Point to grotto 1 + Composite(Marathon) { + BTC.Run("MediaPlayer.VIDEOS.AbbruchF1") + + Composite(Sequence) { + BTC.Wait(7) + BTC.FadeOut("FadeScene.XRInteractionHandsSetup.Black") + } + } + + BTC.SetEntryLevel(2) BTC.Run("LoadScene.NEXT.32Grotto1") } } diff --git a/Viagg-io/Assets/Packages/MyBT/BTC/BTC.cs b/Viagg-io/Assets/Packages/MyBT/BTC/BTC.cs index 61f1203a..9ce12bf6 100644 --- a/Viagg-io/Assets/Packages/MyBT/BTC/BTC.cs +++ b/Viagg-io/Assets/Packages/MyBT/BTC/BTC.cs @@ -1159,13 +1159,12 @@ public class BTC : MonoBehaviour { #region Entry Level Point [Task] - public void GoToGrottoKueche() + public void CheckEntryLevel(int entryPoint) { if (Task.getState == NodeState.FirstRun) { - if (EntryLevel.GoToGrottoKueche) + if (EntryLevel.entries[entryPoint] == true) { - Debug.Log("Go to Grotto Kueche"); Task.SetSucceeded(); return; } @@ -1178,21 +1177,24 @@ public class BTC : MonoBehaviour { } [Task] - public void GoToGrottoEssen() + public void SetEntryLevel(int entryPoint) { if (Task.getState == NodeState.FirstRun) { - if (EntryLevel.GoToGrottoEssen) - { - Debug.Log("Go to Grotto Essen"); - Task.SetSucceeded(); - return; - } - else - { - Task.SetFailed(); - return; - } + EntryLevel.entries[entryPoint] = true; + Task.SetSucceeded(); + return; + } + } + + [Task] + public void ResetEntryLevel(int entryPoint) + { + if (Task.getState == NodeState.FirstRun) + { + EntryLevel.entries[entryPoint] = false; + Task.SetSucceeded(); + return; } } #endregion diff --git a/Viagg-io/Assets/Scripts/EntryLevel.cs b/Viagg-io/Assets/Scripts/EntryLevel.cs index 1a6a70b1..1595d524 100644 --- a/Viagg-io/Assets/Scripts/EntryLevel.cs +++ b/Viagg-io/Assets/Scripts/EntryLevel.cs @@ -4,6 +4,10 @@ using UnityEngine; public static class EntryLevel { - public static bool GoToGrottoKueche = false; - public static bool GoToGrottoEssen = false; + /* Entry Levels: + * 0: Minigame SBB + * 1: Minigame Grotto + * 2: Grotto Kochen Abbruch + */ + public static bool[] entries = new bool[3]; } diff --git a/Viagg-io/Assets/Scripts/LevelManager.cs b/Viagg-io/Assets/Scripts/LevelManager.cs index f2d92235..978be267 100644 --- a/Viagg-io/Assets/Scripts/LevelManager.cs +++ b/Viagg-io/Assets/Scripts/LevelManager.cs @@ -12,15 +12,8 @@ public class LevelManager : MonoBehaviour { public Button levelButton; public string sceneName; - public string jumpPoint; } - [SerializeField] - string jumpPointGrottoEssen; - - [SerializeField] - string jumpPointGrottoKueche; - [SerializeField] float fadeDuration = 2f; @@ -34,10 +27,6 @@ public class LevelManager : MonoBehaviour private void Awake() { - // Reset entry level points - EntryLevel.GoToGrottoKueche = false; - EntryLevel.GoToGrottoEssen = false; - // Loop through each level entry and hook up the button to load the correct scene foreach (var entry in levels) { @@ -48,10 +37,6 @@ public class LevelManager : MonoBehaviour string sceneToLoad = entry.sceneName; entry.levelButton.onClick.AddListener(() => OnClickLoadLevel(sceneToLoad)); - - string goToJumpPoint = entry.jumpPoint; - - entry.levelButton.onClick.AddListener(() => SetEntryLevel(goToJumpPoint)); } } @@ -98,24 +83,4 @@ public class LevelManager : MonoBehaviour color.a = 1f; _fadeMaterial.color = color; } - - public void SetEntryLevel(string entryPoint) - { - if (string.IsNullOrEmpty(entryPoint)) - { - return; - } - - if (entryPoint == jumpPointGrottoEssen) - { - EntryLevel.GoToGrottoEssen = true; - return; - } - - if (entryPoint == jumpPointGrottoKueche) - { - EntryLevel.GoToGrottoKueche = true; - return; - } - } }