Compare commits

..

2 Commits

11 changed files with 777 additions and 227 deletions

View File

@ -8,9 +8,9 @@
RunTree("32_Grotto_Kueche_Intro") RunTree("32_Grotto_Kueche_Intro")
RunTree("32_Grotto_Kueche_Zwiebeln_schneiden") RunTree("32_Grotto_Kueche_Zwiebeln_schneiden")
RunTree("32_Grotto_Kueche_alles_gefunden") RunTree("32_Grotto_Kueche_alles_gefunden")
RunTree("32_Grotto_Kueche_Kochen_Anzahl") //RunTree("32_Grotto_Kueche_Kochen_Anzahl")
RunTree("32_Grotto_Kueche_Zusammen_Kochen") //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") { Tree("32_Grotto_Kueche_Intro") {
// --- Kueche - Intro --- // --- Kueche - Intro ---
Composite(Sequence) { Composite(Sequence) {
// Initialization
BTC.Run("StudioEventEmitter.STATIC.Ambi3D")
BTC.Run("AudioSource.AUDIO.Kueche1FIntro") BTC.Run("AudioSource.AUDIO.Kueche1FIntro")
// Schuerze greifen // Schuerze greifen
BTC.Run("GO/NamedGrabEvent.INTERACTABLES.Schuerze") BTC.Run("GO/NamedGrabEvent.INTERACTABLES.Schuerze")
//BTC.GetKeyDown("Return")
BTC.Hide("GO/NamedGrabEvent.INTERACTABLES.Schuerze") BTC.Hide("GO/NamedGrabEvent.INTERACTABLES.Schuerze")
BTC.SynthesizeText("Lies mir bitte das Rezept vor.") BTC.SynthesizeText("Lies mir bitte das Rezept vor.")
@ -562,9 +564,11 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") {
// Zwiebeln schneiden // Zwiebeln schneiden
BTC.Set("Collider.INTERACTABLES.ZwiebelTrigger", "otherTag", "Messer") BTC.Set("Collider.INTERACTABLES.ZwiebelTrigger", "otherTag", "Messer")
BTC.Run("Collider.INTERACTABLES.ZwiebelTrigger") BTC.Run("Collider.INTERACTABLES.ZwiebelTrigger")
Composite(Marathon) {
BTC.Run("StudioEventEmitter.INTERACTABLES.ZwiebelSchneiden") BTC.Run("StudioEventEmitter.INTERACTABLES.ZwiebelSchneiden")
BTC.Hide("GO.INTERACTABLES.Zwiebel01") BTC.Hide("GO.INTERACTABLES.Zwiebel01")
BTC.Show("GO.INTERACTABLES.GeschnitteneZwiebe") BTC.Show("GO.INTERACTABLES.GeschnitteneZwiebe")
}
BTC.SynthesizeText("Bitte suche nun die anderen Zutaten zusammen. Ich räume in der Zwischenzeit ein bisschen auf.") BTC.SynthesizeText("Bitte suche nun die anderen Zutaten zusammen. Ich räume in der Zwischenzeit ein bisschen auf.")
BTC.SpeechOutputEnded() BTC.SpeechOutputEnded()
@ -792,15 +796,14 @@ Tree("32_Grotto_Kueche_alles_gefunden") {
BTC.Run("Collider.INTERACTABLES.Topf") BTC.Run("Collider.INTERACTABLES.Topf")
BTC.Run("AudioSource.AUDIO.Kueche2Fallesgefun") BTC.Run("AudioSource.AUDIO.Kueche2Fallesgefun")
// Herd anstellen // Herd anstellen - ToDo: Handling in Story?
BTC.Run("NamedGrabEvent.STATIC.Herdschalter") BTC.Run("NamedGrabEvent.STATIC.Herdschalter")
BTC.Show("GO/StudioEventEmitter.STATIC.Herdplatteanstelle") BTC.Run("StudioEventEmitter.STATIC.HerdplatteAnstelle")
// Zwiebeln in Topf geben // Zwiebeln in Topf geben
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Zwiebeln") BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Zwiebeln")
BTC.Run("Collider.INTERACTABLES.Topf") BTC.Run("Collider.INTERACTABLES.Topf")
//BTC.StartSound("StudioEventEmitter.INTERACTABLES.ZwiebelninTopf") BTC.Run("StudioEventEmitter.INTERACTABLES.ZwiebelnInTopf")
BTC.Show("GO/StudioEventEmitter.INTERACTABLES.ZwiebelninTopf")
BTC.Run("AudioSource.AUDIO.Kueche3Fallesgefun") BTC.Run("AudioSource.AUDIO.Kueche3Fallesgefun")
@ -1043,9 +1046,9 @@ Tree("32_Grotto_Kueche_Zusammen_Kochen") {
// Wein in Topf giessen - Todo: Particle Trigger // Wein in Topf giessen - Todo: Particle Trigger
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Weisswein") BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Weisswein")
BTC.Run("Collider.INTERACTABLES.Topf") BTC.Run("Collider.INTERACTABLES.Topf")
BTC.Hide("GO/StudioEventEmitter.INTERACTABLES.ZwiebelninTopf") BTC.StopSound("StudioEventEmitter.INTERACTABLES.ZwiebelnInTopf")
BTC.Show("GO.INTERACTABLES.Abloeschen") BTC.Run("StudioEventEmitter.INTERACTABLES.Abloeschen")
BTC.Show("GO.INTERACTABLES.ChangeSound") BTC.Show("GO.INTERACTABLES.ChangeSound") // Ruehren
BTC.Run("AudioSource.AUDIO.Kueche3FZusammenKo") BTC.Run("AudioSource.AUDIO.Kueche3FZusammenKo")
// Bouillon leuchtet // Bouillon leuchtet
@ -1064,7 +1067,8 @@ Tree("32_Grotto_Kueche_Zusammen_Kochen") {
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Steinpilze") BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Steinpilze")
BTC.Run("Collider.INTERACTABLES.Topf") BTC.Run("Collider.INTERACTABLES.Topf")
RunTree("32_Grotto_Kueche_Parmigiano") //RunTree("32_Grotto_Kueche_Parmigiano")
RunTree("32_Grotto_Im_Grotto_Essen_Intro")
} }
} }
@ -1169,7 +1173,24 @@ Tree("32_Grotto_Kueche_Parmigiano") {
} }
Tree("32_Grotto_Im_Grotto_Essen_Intro") { 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") { Tree("32_Grotto_Kueche_Hide") {

View File

@ -277,18 +277,6 @@ public class BTC : MonoBehaviour {
} }
} }
[Task]
public void StartSound(string objectName)
{
List<ComponentHandler> handlers = GetHandlers(objectName);
handlers.ForEach(handler => handler.StartSound(Task.getState));
if (handlers.Count == 0)
{
Debug.LogWarning($"BTC.StartSound: no components under the name '{objectName}'");
Task.SetSucceeded();
}
}
[Task] [Task]
public void StopSound(string objectName) public void StopSound(string objectName)
{ {

View File

@ -220,14 +220,6 @@ public class ComponentHandler : MonoBehaviour {
} }
} }
public virtual void StartSound(MyBT.NodeState nodeState)
{
if (Task.isDebugging)
{
Debug.LogWarning($"ComponentHandler.StartSound: not implemented for {this.GetType()}");
}
}
public virtual void StopSound(MyBT.NodeState nodeState) public virtual void StopSound(MyBT.NodeState nodeState)
{ {
if (Task.isDebugging) if (Task.isDebugging)

View File

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

View File

@ -1 +1 @@
2025-01-07T15:36:13.6061680Z 2025-01-08T12:58:31.1629980Z

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,7 @@ using FMODUnity;
[RequireComponent(typeof(Rigidbody))] [RequireComponent(typeof(Rigidbody))]
public class OnCollideSound : MonoBehaviour public class OnCollideSound : MonoBehaviour
{ {
#if FMOD_AVAILABLE
[SerializeField] [SerializeField]
EventReference soundRef; EventReference soundRef;
@ -53,4 +54,5 @@ public class OnCollideSound : MonoBehaviour
_specialCase = false; _specialCase = false;
} }
} }
#endif
} }

View File

@ -10,6 +10,7 @@ using FMODUnity;
[RequireComponent(typeof(XRGrabInteractable))] [RequireComponent(typeof(XRGrabInteractable))]
public class OnGrabSound : MonoBehaviour public class OnGrabSound : MonoBehaviour
{ {
#if FMOD_AVAILABLE
[SerializeField] [SerializeField]
EventReference soundRef; EventReference soundRef;
@ -26,4 +27,5 @@ public class OnGrabSound : MonoBehaviour
{ {
RuntimeManager.PlayOneShot(soundRef, transform.position); RuntimeManager.PlayOneShot(soundRef, transform.position);
} }
#endif
} }

View File

@ -9,6 +9,7 @@ using FMODUnity;
public class OnSocketSnapSound : MonoBehaviour public class OnSocketSnapSound : MonoBehaviour
{ {
#if FMOD_AVAILABLE
[SerializeField] [SerializeField]
EventReference soundRef; EventReference soundRef;
@ -25,4 +26,5 @@ public class OnSocketSnapSound : MonoBehaviour
{ {
RuntimeManager.PlayOneShot(soundRef, transform.position); RuntimeManager.PlayOneShot(soundRef, transform.position);
} }
#endif
} }

View File

@ -8,6 +8,7 @@ using FMODUnity;
public class OnStirringSound : MonoBehaviour public class OnStirringSound : MonoBehaviour
{ {
#if FMOD_AVAILABLE
[SerializeField] [SerializeField]
EventReference stirringDrySoundRef; EventReference stirringDrySoundRef;
@ -19,4 +20,5 @@ public class OnStirringSound : MonoBehaviour
emitter.Stop(); emitter.Stop();
emitter.ChangeEvent(stirringDrySoundRef); emitter.ChangeEvent(stirringDrySoundRef);
} }
#endif
} }

View File

@ -140,6 +140,9 @@ PlayerSettings:
bundleVersion: 0.1 bundleVersion: 0.1
preloadedAssets: preloadedAssets:
- {fileID: 11400000, guid: be340e3c48769439d8d18a5a2bccd498, type: 2} - {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 metroInputSource: 0
wsaTransparentSwapchain: 0 wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1 m_HolographicPauseOnTrackingLoss: 1