Compare commits

...

9 Commits

20 changed files with 647388 additions and 624164 deletions

View File

@ -5,12 +5,12 @@
//RunTree("32_Grotto_Story_B_Grotto_Intro")
//RunTree("32_Grotto_Kueche_Intro")
RunTree("32_Grotto_Kueche_Intro")
RunTree("32_Grotto_Kueche_Zwiebeln_schneiden")
RunTree("32_Grotto_Kueche_alles_gefunden")
//RunTree("32_Grotto_Kueche_Kochen_Anzahl")
//RunTree("32_Grotto_Kueche_Zusammen_Kochen")
//RunTree("32_Grotto_Im_Grotto_Essen_Intro")
}
}
@ -458,11 +458,13 @@ Tree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto") {
Tree("32_Grotto_Kueche_Intro") {
// --- Kueche - Intro ---
Composite(Sequence) {
// Initialization
BTC.Run("StudioEventEmitter.STATIC.Ambi3D")
BTC.Run("AudioSource.AUDIO.Kueche1FIntro")
// Schuerze greifen
BTC.Run("GO/NamedGrabEvent.INTERACTABLES.Schuerze")
//BTC.GetKeyDown("Return")
BTC.Hide("GO/NamedGrabEvent.INTERACTABLES.Schuerze")
BTC.SynthesizeText("Lies mir bitte das Rezept vor.")
@ -562,10 +564,12 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") {
// Zwiebeln schneiden
BTC.Set("Collider.INTERACTABLES.ZwiebelTrigger", "otherTag", "Messer")
BTC.Run("Collider.INTERACTABLES.ZwiebelTrigger")
BTC.Run("StudioEventEmitter.INTERACTABLES.ZwiebelSchneiden")
BTC.Hide("GO.INTERACTABLES.Zwiebel01")
BTC.Show("GO.INTERACTABLES.GeschnitteneZwiebe")
Composite(Marathon) {
BTC.Run("StudioEventEmitter.INTERACTABLES.ZwiebelSchneiden")
BTC.Hide("GO.INTERACTABLES.Zwiebel01")
BTC.Show("GO.INTERACTABLES.GeschnitteneZwiebe")
}
BTC.SynthesizeText("Bitte suche nun die anderen Zutaten zusammen. Ich räume in der Zwischenzeit ein bisschen auf.")
BTC.SpeechOutputEnded()
@ -787,14 +791,20 @@ Tree("32_Grotto_Kueche_alles_gefunden") {
BTC.SynthesizeText("Super, du hast alles gefunden. Bitte gib nun etwas Olivenöl in den Topf.")
BTC.SpeechOutputEnded()
// Oel in Topf geben - Particle Trigger
// ...
// Oel in Topf geben - ToDo: Particle Trigger
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Olivenoel")
BTC.Run("Collider.INTERACTABLES.Topf")
BTC.Run("AudioSource.AUDIO.Kueche2Fallesgefun")
// Herd anstellen - ToDo: Handling in Story?
BTC.Run("NamedGrabEvent.STATIC.Herdschalter")
BTC.Run("StudioEventEmitter.STATIC.HerdplatteAnstelle")
// Zwiebeln in Topf geben
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Zwiebeln")
BTC.Run("Collider.INTERACTABLES.Topf")
BTC.Start("StudioEventEmitter.STATIC.Herdplatte")
BTC.Run("StudioEventEmitter.INTERACTABLES.ZwiebelnInTopf")
BTC.Run("AudioSource.AUDIO.Kueche3Fallesgefun")
// Frage beantworten
@ -904,6 +914,7 @@ Tree("32_Grotto_Kueche_Interesse_Kochen") {
// --- Kueche - Interesse Kochen ---
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FInteresseK")
// ToDo: Freie Antwort als Speech Input
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Lasagne")
BTC.Show("GO.HANDMENU.Option1Button")
BTC.SetBool("32_Grotto_Kueche_Interesse_Kochen_Button_Clicked", false)
@ -1016,16 +1027,13 @@ Tree("32_Grotto_Kueche_Zusammen_Kochen") {
BTC.Run("AudioSource.AUDIO.Kueche1FZusammenKo")
// Risotto in Topf geben
BTC.Run("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Risotto")
BTC.Run("Collider.INTERACTABLES.Topf")
// Ruehren
BTC.Run("NamedGrabEvent.INTERACTABLES.Loeffel")
// Ruehren
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Loeffel")
BTC.Run("Collider.INTERACTABLES.Topf")
// Wie lange ruehren?
BTC.Wait(2)
BTC.Wait(2) // Wie lange ruehren?
BTC.Run("AudioSource.AUDIO.Kueche2FZusammenKo")
// Wein leuchtet
@ -1035,10 +1043,24 @@ Tree("32_Grotto_Kueche_Zusammen_Kochen") {
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
// Wein in Topf giessen
// ...
BTC.Run("AudioSource.AUDIO.Kueche3FZusammenKo")
// Wein in Topf giessen - Todo: Particle Trigger
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Weisswein")
BTC.Run("Collider.INTERACTABLES.Topf")
BTC.StopSound("StudioEventEmitter.INTERACTABLES.ZwiebelnInTopf")
BTC.Run("StudioEventEmitter.INTERACTABLES.Abloeschen")
Composite(Marathon) {
Composite(Sequence) {
BTC.Wait(6)
BTC.SetFloat("StudioEventEmitter.INTERACTABLES.Abloeschen", "blubbern.transition", 1)
BTC.Show("GO.INTERACTABLES.ChangeSound") // Ruehren
}
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche3FZusammenKo")
}
}
// Bouillon leuchtet
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
@ -1046,16 +1068,17 @@ Tree("32_Grotto_Kueche_Zusammen_Kochen") {
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
// Bouillon in Topf geben
// ...
// Bouillon in Topf geben - Todo: Particle Trigger
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Bouillon")
BTC.Run("Collider.INTERACTABLES.Topf")
BTC.Run("AudioSource.AUDIO.Kueche4FZusammenKo")
// Glas Wasser mit Steinpilze in Topf geben
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Steinpilze")
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Steinpilze")
BTC.Run("Collider.INTERACTABLES.Topf")
RunTree("32_Grotto_Kueche_Parmigiano")
//RunTree("32_Grotto_Kueche_Parmigiano")
RunTree("32_Grotto_Im_Grotto_Essen_Intro")
}
}
@ -1160,7 +1183,24 @@ Tree("32_Grotto_Kueche_Parmigiano") {
}
Tree("32_Grotto_Im_Grotto_Essen_Intro") {
// --- Im Grotto Essen - Intro ---
Composite(Sequence) {
BTC.Wait(10)
// Initialization
Composite(Marathon) {
BTC.SetPosition("GO.XRInteractionHandsSetup.XROrigin", -3.837, 0, -10.676)
BTC.SetPosition("GO.HANDMENU", -3.837, 0, -10.676)
BTC.Run("StudioEventEmitter.STATIC.KuechenAmbi")
BTC.Run("StudioEventEmitter.AUDIO.Ambi2D")
BTC.StopSound("StudioEventEmitter.STATIC.Ambi3D")
BTC.StopSound("StudioEventEmitter.STATIC.HerdplatteAnstelle")
BTC.StopSound("StudioEventEmitter.INTERACTABLES.Abloeschen")
}
BTC.GetKeyDown("Return")
}
}
Tree("32_Grotto_Kueche_Hide") {

View File

@ -217,6 +217,18 @@ public class BTC : MonoBehaviour {
}
}
[Task]
public void SetFloat(string objectName, string key, float value)
{
List<ComponentHandler> handlers = GetHandlers(objectName);
handlers.ForEach(handler => handler.SetFloat(Task.getState, key, value));
if (handlers.Count == 0)
{
Debug.LogWarning($"BTC.SetFloat: no components under the name '{objectName}'");
Task.SetSucceeded();
}
}
[Task]
public void Enable(string objectName)
{
@ -278,25 +290,13 @@ public class BTC : MonoBehaviour {
}
[Task]
public void Start(string objectName)
public void StopSound(string objectName)
{
List<ComponentHandler> handlers = GetHandlers(objectName);
handlers.ForEach(handler => handler.Start(Task.getState));
handlers.ForEach(handler => handler.StopSound(Task.getState));
if (handlers.Count == 0)
{
Debug.LogWarning($"BTC.Start: no components under the name '{objectName}'");
Task.SetSucceeded();
}
}
[Task]
public void Stop(string objectName)
{
List<ComponentHandler> handlers = GetHandlers(objectName);
handlers.ForEach(handler => handler.Stop(Task.getState));
if (handlers.Count == 0)
{
Debug.LogWarning($"BTC.Stop: no components under the name '{objectName}'");
Debug.LogWarning($"BTC.StopSound: no components under the name '{objectName}'");
Task.SetSucceeded();
}
}

View File

@ -180,6 +180,15 @@ public class ComponentHandler : MonoBehaviour {
Task.SetError();
}
public virtual void SetFloat(MyBT.NodeState nodeState, string key, float value)
{
if (Task.isDebugging)
{
Debug.LogWarning($"ComponentHandler.SetFloat: not implemented for {this.GetType()}");
}
Task.SetError();
}
public virtual void Enable(MyBT.NodeState nodeState)
{
if (Task.isDebugging)
@ -220,19 +229,11 @@ public class ComponentHandler : MonoBehaviour {
}
}
public virtual void Start(MyBT.NodeState nodeState)
public virtual void StopSound(MyBT.NodeState nodeState)
{
if (Task.isDebugging)
{
Debug.LogWarning($"ComponentHandler.Start: not implemented for {this.GetType()}");
}
}
public virtual void Stop(MyBT.NodeState nodeState)
{
if (Task.isDebugging)
{
Debug.LogWarning($"ComponentHandler.Stop: not implemented for {this.GetType()}");
Debug.LogWarning($"ComponentHandler.StopSound: not implemented for {this.GetType()}");
}
}

View File

@ -71,55 +71,55 @@ public class NamedStudioEventEmitter : ComponentHandler {
public override void Run(MyBT.NodeState nodeState) {
// whan aborting
if (nodeState == NodeState.Aborting) {
studioEventEmitter.Stop();
bool isOneShot;
studioEventEmitter.EventDescription.isOneshot(out isOneShot);
if (isOneShot)
{
studioEventEmitter.Stop();
}
return;
}
// at start
if (nodeState == NodeState.FirstRun) {
// reset event trigger
studioEventEmitter.Play();
UnityEngine.Debug.Log($"NamedStudioEventEmitter: Event from {gameObject.name} start playing.");
}
// int val;
// FMOD.RESULT res = studioEventEmitter.EventInstance.getTimelinePosition(out val);
// during runtime
if (nodeState == NodeState.Running) {
bool isOneShot;
studioEventEmitter.EventDescription.isOneshot(out isOneShot);
if (!isOneShot)
{
Task.SetSucceeded();
return;
}
if (!studioEventEmitter.IsPlaying()) {
Task.SetSucceeded();
return;
}
}
}
public override void Start(MyBT.NodeState nodeState)
// For Looping Sounds
public override void StopSound(MyBT.NodeState nodeState)
{
if (nodeState == NodeState.Aborting)
{
studioEventEmitter.Stop();
return;
}
if (nodeState == NodeState.FirstRun)
{
studioEventEmitter.Play();
studioEventEmitter.Stop();
Task.SetSucceeded();
return;
}
}
public override void Stop(MyBT.NodeState nodeState)
public override void SetFloat(NodeState nodeState, string key, float value)
{
if (nodeState == NodeState.Aborting)
{
studioEventEmitter.Stop();
return;
}
if (nodeState == NodeState.FirstRun)
{
studioEventEmitter.Stop();
studioEventEmitter.SetParameter(key, value);
Task.SetSucceeded();
return;
}

View File

@ -405,5 +405,12 @@ namespace FMODUnity
}
return false;
}
public void ChangeEvent(EventReference eventRef)
{
Stop();
EventReference = eventRef;
Lookup();
}
}
}

View File

@ -1 +1 @@
2024-12-10T18:42:57.0313470Z
2025-01-08T20:00:27.2696630Z

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if FMOD_AVAILABLE
using FMODUnity;
#endif
public class ChangeFMODEvent : MonoBehaviour
{
#if FMOD_AVAILABLE
[SerializeField]
EventReference _newSoundRef;
[SerializeField]
StudioEventEmitter _emitter;
void Start()
{
_emitter.Stop();
_emitter.ChangeEvent(_newSoundRef);
}
#endif
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b0b655e179ae44f17a6518841330b41a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,11 +1,15 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if FMOD_AVAILABLE
using FMOD;
using FMODUnity;
#endif
[RequireComponent(typeof(Rigidbody))]
public class OnCollideSound : MonoBehaviour
{
#if FMOD_AVAILABLE
[SerializeField]
EventReference soundRef;
@ -44,10 +48,11 @@ public class OnCollideSound : MonoBehaviour
{
// Play default collide sound
RuntimeManager.PlayOneShot(soundRef, transform.position);
Debug.Log(gameObject.name);
UnityEngine.Debug.Log(gameObject.name);
}
_specialCase = false;
}
}
#endif
}

View File

@ -2,11 +2,15 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
#if FMOD_AVAILABLE
using FMOD;
using FMODUnity;
#endif
[RequireComponent(typeof(XRGrabInteractable))]
public class OnGrabSound : MonoBehaviour
{
#if FMOD_AVAILABLE
[SerializeField]
EventReference soundRef;
@ -23,4 +27,5 @@ public class OnGrabSound : MonoBehaviour
{
RuntimeManager.PlayOneShot(soundRef, transform.position);
}
#endif
}

View File

@ -2,10 +2,14 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
#if FMOD_AVAILABLE
using FMOD;
using FMODUnity;
#endif
public class OnSocketSnapSound : MonoBehaviour
{
#if FMOD_AVAILABLE
[SerializeField]
EventReference soundRef;
@ -22,4 +26,5 @@ public class OnSocketSnapSound : MonoBehaviour
{
RuntimeManager.PlayOneShot(soundRef, transform.position);
}
#endif
}

View File

@ -0,0 +1,42 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if FMOD_AVAILABLE
using FMOD;
using FMODUnity;
#endif
public class OnStirringSound : MonoBehaviour
{
#if FMOD_AVAILABLE
[SerializeField]
Rigidbody _rigidbody;
StudioEventEmitter _stirringSoundEvent;
void Start()
{
_stirringSoundEvent = GetComponent<StudioEventEmitter>();
}
void Update()
{
if (_rigidbody.velocity != Vector3.zero)
{
if (!_stirringSoundEvent.IsPlaying())
{
_stirringSoundEvent.Play();
}
}
else
{
_stirringSoundEvent.Stop();
}
}
void OnDestroy()
{
_stirringSoundEvent.Stop();
}
#endif
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 753dee63ed4644fb4826b73d51770690
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OnTriggerPot : MonoBehaviour
{
[SerializeField]
string loeffelTag;
[SerializeField]
GameObject stirringSound;
private void OnTriggerEnter(Collider other)
{
if (other.tag == loeffelTag)
{
stirringSound.SetActive(true);
}
}
private void OnTriggerExit(Collider other)
{
if (other.tag == loeffelTag)
{
stirringSound.SetActive(false);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 87cfd4637a2f74f57b00dff0a8870cb9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -140,6 +140,9 @@ PlayerSettings:
bundleVersion: 0.1
preloadedAssets:
- {fileID: 11400000, guid: be340e3c48769439d8d18a5a2bccd498, type: 2}
- {fileID: 11400000, guid: bfa1182bd221b4ca89619141f66f1260, type: 2}
- {fileID: -8196854396901781169, guid: 1a4c68ca72a83449f938d669337cb305, type: 2}
- {fileID: -64324148185763206, guid: a9a6963505ddf7f4d886008c6dc86122, type: 2}
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1