Compare commits
2 Commits
6128ae9982
...
7a66f72aa8
Author | SHA1 | Date |
---|---|---|
Nadine Ganz | 7a66f72aa8 | |
Nadine Ganz | 75d6785dc6 |
|
@ -1048,9 +1048,19 @@ Tree("32_Grotto_Kueche_Zusammen_Kochen") {
|
|||
BTC.Run("Collider.INTERACTABLES.Topf")
|
||||
BTC.StopSound("StudioEventEmitter.INTERACTABLES.ZwiebelnInTopf")
|
||||
BTC.Run("StudioEventEmitter.INTERACTABLES.Abloeschen")
|
||||
BTC.Show("GO.INTERACTABLES.ChangeSound") // Ruehren
|
||||
BTC.Run("AudioSource.AUDIO.Kueche3FZusammenKo")
|
||||
|
||||
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")
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -114,6 +114,16 @@ public class NamedStudioEventEmitter : ComponentHandler {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetFloat(NodeState nodeState, string key, float value)
|
||||
{
|
||||
if (nodeState == NodeState.FirstRun)
|
||||
{
|
||||
studioEventEmitter.SetParameter(key, value);
|
||||
Task.SetSucceeded();
|
||||
return;
|
||||
}
|
||||
}
|
||||
#else
|
||||
[Header("FMod Support disabled: Window->MyBT->PreCompiler Definitions")]
|
||||
public string dummy;
|
||||
|
|
|
@ -1 +1 @@
|
|||
2025-01-08T12:58:31.1629980Z
|
||||
2025-01-08T20:00:27.2696630Z
|
File diff suppressed because it is too large
Load Diff
|
@ -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
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b0b655e179ae44f17a6518841330b41a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -10,15 +10,33 @@ public class OnStirringSound : MonoBehaviour
|
|||
{
|
||||
#if FMOD_AVAILABLE
|
||||
[SerializeField]
|
||||
EventReference stirringDrySoundRef;
|
||||
Rigidbody _rigidbody;
|
||||
|
||||
[SerializeField]
|
||||
StudioEventEmitter emitter;
|
||||
StudioEventEmitter _stirringSoundEvent;
|
||||
|
||||
void Start()
|
||||
{
|
||||
emitter.Stop();
|
||||
emitter.ChangeEvent(stirringDrySoundRef);
|
||||
_stirringSoundEvent = GetComponent<StudioEventEmitter>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (_rigidbody.velocity != Vector3.zero)
|
||||
{
|
||||
if (!_stirringSoundEvent.IsPlaying())
|
||||
{
|
||||
_stirringSoundEvent.Play();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_stirringSoundEvent.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
_stirringSoundEvent.Stop();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 87cfd4637a2f74f57b00dff0a8870cb9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue