diff --git a/Viagg-io/Assets/BehaviourTrees/3.2-Grotto.bt.txt b/Viagg-io/Assets/BehaviourTrees/3.2-Grotto.bt.txt index cd3024ca..32daf479 100644 --- a/Viagg-io/Assets/BehaviourTrees/3.2-Grotto.bt.txt +++ b/Viagg-io/Assets/BehaviourTrees/3.2-Grotto.bt.txt @@ -12,12 +12,11 @@ } Composite(Sequence) { - //RunTree("32_Grotto_Story_B_Grotto_Intro") + RunTree("32_Grotto_Story_B_Grotto_Intro") //RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto") - //BTC.SetPosition("GO.XRInteractionHandsSetup.XROrigin", -7.036, 0, -16.413) - //BTC.SetPosition("GO.HANDMENU", -7.036, 0, -16.413) - RunTree("32_Grotto_Kueche_Intro") + //RunTree("32_Grotto_Kueche_Init") + //RunTree("32_Grotto_Kueche_Intro") //RunTree("32_Grotto_Kueche_Zwiebeln_schneiden") //RunTree("32_Grotto_Kueche_alles_gefunden") //RunTree("32_Grotto_Kueche_Interesse_Kochen") @@ -437,6 +436,7 @@ Tree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Kueche") { } } + RunTree("32_Grotto_Kueche_Init") RunTree("32_Grotto_Kueche_Intro") } } @@ -550,19 +550,26 @@ Tree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto") { BTC.Run("Depthkit.VIDEOS.AntwortNonnaGrotto_15") BTC.Hide("Depthkit.VIDEOS.AntwortNonnaGrotto_15") + RunTree("32_Grotto_Im_Grotto_Essen_Init") RunTree("32_Grotto_Im_Grotto_Essen_Intro") } } +Tree("32_Grotto_Kueche_Init") { + Composite(Marathon) { + // Initialization + //BTC.Run("StudioEventEmitter.STATIC.Ambi3D") + BTC.StopSound("StudioEventEmitter.STATIC.AmbiGarten") + BTC.SetPosition("GO.XRInteractionHandsSetup.XROrigin", -7.036, 0, -16.413) + BTC.SetPosition("GO.HANDMENU", -7.036, 0, -16.413) + BTC.RotateToAngle("GO.XRInteractionHandsSetup.XROrigin", 90.0) + BTC.RotateToAngle("GO.HANDMENU", 90.0) + } +} + Tree("32_Grotto_Kueche_Intro") { // --- Kueche - Intro --- Composite(Sequence) { - // Initialization - //BTC.Run("StudioEventEmitter.STATIC.Ambi3D") - BTC.StopSound("StudioEventEmitter.STATIC.AmbiGarten") - BTC.SetPosition("GO.XRInteractionHandsSetup.XROrigin", -7.036, 0, -16.413) - BTC.SetPosition("GO.HANDMENU", -7.036, 0, -16.413) - BTC.Show("Depthkit.VIDEOS.Intro1Kueche") BTC.Run("Depthkit.VIDEOS.Intro1Kueche") BTC.Hide("Depthkit.VIDEOS.Intro1Kueche") @@ -1413,6 +1420,8 @@ Tree("32_Grotto_Im_Grotto_Essen_Init") { Composite(Marathon) { BTC.SetPosition("GO.XRInteractionHandsSetup.XROrigin", -4.648, 0, -12.295) BTC.SetPosition("GO.HANDMENU", -4.648, 0, -12.295) + BTC.RotateToAngle("GO.XRInteractionHandsSetup.XROrigin", 0.0) + BTC.RotateToAngle("GO.HANDMENU", 0.0) BTC.Run("StudioEventEmitter.STATIC.KuechenAmbi") BTC.Run("StudioEventEmitter.STATIC.AmbiGarten") //BTC.StopSound("StudioEventEmitter.STATIC.Ambi3D") @@ -1900,6 +1909,8 @@ Tree("32_Grotto_Im_Grotto_Essen_Intro") { // --- Im Grotto Essen - Outro --- BTC.SetPosition("GO.XRInteractionHandsSetup.XROrigin", -1.14, 0, 1.698) BTC.SetPosition("GO.HANDMENU", -1.14, 0, 1.698) + BTC.RotateToAngle("GO.XRInteractionHandsSetup.XROrigin", 60.0) + BTC.RotateToAngle("GO.HANDMENU", 60.0) BTC.Show("Depthkit.VIDEOS.Outro1ImGrottoesse") BTC.Run("Depthkit.VIDEOS.Outro1ImGrottoesse") diff --git a/Viagg-io/Assets/Packages/MyBT/BTC/BTC.cs b/Viagg-io/Assets/Packages/MyBT/BTC/BTC.cs index 3fb790ed..1b7f6d7c 100644 --- a/Viagg-io/Assets/Packages/MyBT/BTC/BTC.cs +++ b/Viagg-io/Assets/Packages/MyBT/BTC/BTC.cs @@ -265,6 +265,18 @@ public class BTC : MonoBehaviour { } } + [Task] + public void RotateToAngle(string objectName, float newAngle) + { + List handlers = GetHandlers(objectName); + handlers.ForEach(handler => handler.RotateToAngle(Task.getState, newAngle)); + if (handlers.Count == 0) + { + Debug.LogWarning($"BTC.RotateToAngle: no components under the name '{objectName}'"); + Task.SetSucceeded(); + } + } + [Task] public void AbortEventListener(string objectName) { diff --git a/Viagg-io/Assets/Packages/MyBT/BTC/Handlers/ComponentHandler.cs b/Viagg-io/Assets/Packages/MyBT/BTC/Handlers/ComponentHandler.cs index 790ac11c..85ab230f 100644 --- a/Viagg-io/Assets/Packages/MyBT/BTC/Handlers/ComponentHandler.cs +++ b/Viagg-io/Assets/Packages/MyBT/BTC/Handlers/ComponentHandler.cs @@ -213,6 +213,14 @@ public class ComponentHandler : MonoBehaviour { } } + public virtual void RotateToAngle(MyBT.NodeState nodeState, float newAngle) + { + if (Task.isDebugging) + { + Debug.LogWarning($"ComponentHandler.RotateToAngle: not implemented for {this.GetType()}"); + } + } + public virtual void AbortEventListener(MyBT.NodeState nodeState) { if (Task.isDebugging) diff --git a/Viagg-io/Assets/Packages/MyBT/BTC/Handlers/NamedGameObject.cs b/Viagg-io/Assets/Packages/MyBT/BTC/Handlers/NamedGameObject.cs index 7267b1b4..e1475373 100644 --- a/Viagg-io/Assets/Packages/MyBT/BTC/Handlers/NamedGameObject.cs +++ b/Viagg-io/Assets/Packages/MyBT/BTC/Handlers/NamedGameObject.cs @@ -91,6 +91,16 @@ public class NamedGameObject : ComponentHandler { } } + public override void RotateToAngle(NodeState nodeState, float targetAngle) + { + if ((nodeState == NodeState.FirstRun) || (nodeState == NodeState.Running)) + { + // Rotate y-Achse + gameObject.transform.rotation = Quaternion.Euler(0, targetAngle, 0); + Task.SetSucceeded(); + } + } + public GameObject go; public string objName = "GoXY"; } diff --git a/Viagg-io/Assets/Prefabs/UI/_HANDMENU.prefab b/Viagg-io/Assets/Prefabs/UI/_HANDMENU.prefab index 56ce8842..b1b0dc44 100644 --- a/Viagg-io/Assets/Prefabs/UI/_HANDMENU.prefab +++ b/Viagg-io/Assets/Prefabs/UI/_HANDMENU.prefab @@ -1678,7 +1678,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &784431681836084746 RectTransform: m_ObjectHideFlags: 0 diff --git a/Viagg-io/Assets/Scenes/3.2-Grotto.unity b/Viagg-io/Assets/Scenes/3.2-Grotto.unity index 26948a11..b2f11321 100644 --- a/Viagg-io/Assets/Scenes/3.2-Grotto.unity +++ b/Viagg-io/Assets/Scenes/3.2-Grotto.unity @@ -13196,6 +13196,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 8253431605697638319, guid: 60c78457019c15140b2e111cef443df3, type: 3} + propertyPath: m_Convex + value: 1 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -81918,7 +81922,7 @@ MonoBehaviour: overrideLogStringDisplay: 0 overrideDebugInternalActive: 0 overrideDebugChangesActive: 0 - instanceID: 4665756 + instanceID: 407002 __behaviourTreeGenerator: {fileID: 0} taskScripts: - {fileID: 4900000, guid: 7100bc138828c402baf6fdd9c426735b, type: 3}