BT FMOD function for looping sounds
parent
2fee855ece
commit
3e78857cdf
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
//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")
|
||||||
|
|
||||||
|
@ -607,6 +607,7 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") {
|
||||||
// Fail
|
// Fail
|
||||||
//BTC.GetKeyDown("Space")
|
//BTC.GetKeyDown("Space")
|
||||||
BTC.ListenToEvent("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
|
BTC.ListenToEvent("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
|
||||||
|
BTC.Wait(1)
|
||||||
BTC.CompareBool("RisottoIsSnapped", false)
|
BTC.CompareBool("RisottoIsSnapped", false)
|
||||||
|
|
||||||
// Objekt geht zurueck
|
// Objekt geht zurueck
|
||||||
|
@ -635,10 +636,11 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") {
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
// Fail
|
// Fail
|
||||||
BTC.ListenToEvent("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Salz")
|
BTC.ListenToEvent("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Salz")
|
||||||
|
BTC.Wait(1)
|
||||||
BTC.CompareBool("SalzIsSnapped", false)
|
BTC.CompareBool("SalzIsSnapped", false)
|
||||||
|
|
||||||
// Objekt geht zurueck
|
// Objekt geht zurueck
|
||||||
BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Salz", -6.824, 1.335, -18.8996)
|
BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Salz", -6.607, 1.321, -18.8996)
|
||||||
|
|
||||||
BTC.SynthesizeText("Das hast du an den falschen Ort gestellt.")
|
BTC.SynthesizeText("Das hast du an den falschen Ort gestellt.")
|
||||||
BTC.SpeechOutputEnded()
|
BTC.SpeechOutputEnded()
|
||||||
|
@ -663,10 +665,11 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") {
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
// Fail
|
// Fail
|
||||||
BTC.ListenToEvent("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Pfeffer")
|
BTC.ListenToEvent("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Pfeffer")
|
||||||
|
BTC.Wait(1)
|
||||||
BTC.CompareBool("PfefferIsSnapped", false)
|
BTC.CompareBool("PfefferIsSnapped", false)
|
||||||
|
|
||||||
// Objekt geht zurueck
|
// Objekt geht zurueck
|
||||||
BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Pfeffer", -6.824, 1.335, -18.8996)
|
BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Pfeffer", -6.686, 1.321, -18.8996)
|
||||||
|
|
||||||
BTC.SynthesizeText("Das hast du an den falschen Ort gestellt.")
|
BTC.SynthesizeText("Das hast du an den falschen Ort gestellt.")
|
||||||
BTC.SpeechOutputEnded()
|
BTC.SpeechOutputEnded()
|
||||||
|
@ -691,10 +694,11 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") {
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
// Fail
|
// Fail
|
||||||
BTC.ListenToEvent("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
|
BTC.ListenToEvent("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
|
||||||
|
BTC.Wait(1)
|
||||||
BTC.CompareBool("WeissweinIsSnapped", false)
|
BTC.CompareBool("WeissweinIsSnapped", false)
|
||||||
|
|
||||||
// Objekt geht zurueck
|
// Objekt geht zurueck
|
||||||
BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein", -6.824, 1.335, -18.8996)
|
BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein", -6.58, 1.451, -19.0233)
|
||||||
|
|
||||||
BTC.SynthesizeText("Das hast du an den falschen Ort gestellt.")
|
BTC.SynthesizeText("Das hast du an den falschen Ort gestellt.")
|
||||||
BTC.SpeechOutputEnded()
|
BTC.SpeechOutputEnded()
|
||||||
|
@ -719,10 +723,11 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") {
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
// Fail
|
// Fail
|
||||||
BTC.ListenToEvent("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
|
BTC.ListenToEvent("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
|
||||||
|
BTC.Wait(1)
|
||||||
BTC.CompareBool("BouillonIsSnapped", false)
|
BTC.CompareBool("BouillonIsSnapped", false)
|
||||||
|
|
||||||
// Objekt geht zurueck
|
// Objekt geht zurueck
|
||||||
BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon", -6.824, 1.335, -18.8996)
|
BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon", -6.947, 1.402, -18.995)
|
||||||
|
|
||||||
BTC.SynthesizeText("Das hast du an den falschen Ort gestellt.")
|
BTC.SynthesizeText("Das hast du an den falschen Ort gestellt.")
|
||||||
BTC.SpeechOutputEnded()
|
BTC.SpeechOutputEnded()
|
||||||
|
@ -747,10 +752,11 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") {
|
||||||
Composite(Sequence) {
|
Composite(Sequence) {
|
||||||
// Fail
|
// Fail
|
||||||
BTC.ListenToEvent("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Olivenoel")
|
BTC.ListenToEvent("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Olivenoel")
|
||||||
|
BTC.Wait(1)
|
||||||
BTC.CompareBool("OlivenoelIsSnapped", false)
|
BTC.CompareBool("OlivenoelIsSnapped", false)
|
||||||
|
|
||||||
// Objekt geht zurueck
|
// Objekt geht zurueck
|
||||||
BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Olivenoel", -6.824, 1.335, -18.8996)
|
BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Olivenoel", -6.752, 1.449, -19.024)
|
||||||
|
|
||||||
BTC.SynthesizeText("Das hast du an den falschen Ort gestellt.")
|
BTC.SynthesizeText("Das hast du an den falschen Ort gestellt.")
|
||||||
BTC.SpeechOutputEnded()
|
BTC.SpeechOutputEnded()
|
||||||
|
@ -784,12 +790,11 @@ Tree("32_Grotto_Kueche_alles_gefunden") {
|
||||||
// Oel in Topf geben - Particle Trigger
|
// Oel in Topf geben - Particle Trigger
|
||||||
// ...
|
// ...
|
||||||
BTC.Run("AudioSource.AUDIO.Kueche2Fallesgefun")
|
BTC.Run("AudioSource.AUDIO.Kueche2Fallesgefun")
|
||||||
//BTC.GetKeyDown("Return")
|
|
||||||
|
|
||||||
// Zwiebeln in Topf geben
|
// Zwiebeln in Topf geben
|
||||||
BTC.Run("NamedGrabEvent.INTERACTABLES.Zwiebeln")
|
|
||||||
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.Start("StudioEventEmitter.STATIC.Herdplatte")
|
||||||
BTC.Run("AudioSource.AUDIO.Kueche3Fallesgefun")
|
BTC.Run("AudioSource.AUDIO.Kueche3Fallesgefun")
|
||||||
|
|
||||||
// Frage beantworten
|
// Frage beantworten
|
||||||
|
|
|
@ -276,6 +276,30 @@ public class BTC : MonoBehaviour {
|
||||||
Task.SetSucceeded();
|
Task.SetSucceeded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Task]
|
||||||
|
public void Start(string objectName)
|
||||||
|
{
|
||||||
|
List<ComponentHandler> handlers = GetHandlers(objectName);
|
||||||
|
handlers.ForEach(handler => handler.Start(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}'");
|
||||||
|
Task.SetSucceeded();
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region video & sound tasks
|
#region video & sound tasks
|
||||||
|
|
|
@ -220,6 +220,22 @@ public class ComponentHandler : MonoBehaviour {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void Start(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()}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected float sourceAlpha;
|
protected float sourceAlpha;
|
||||||
protected float targetAlpha;
|
protected float targetAlpha;
|
||||||
protected float timeSum;
|
protected float timeSum;
|
||||||
|
|
|
@ -92,8 +92,40 @@ public class NamedStudioEventEmitter : ComponentHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void Start(MyBT.NodeState nodeState)
|
||||||
|
{
|
||||||
|
if (nodeState == NodeState.Aborting)
|
||||||
|
{
|
||||||
|
studioEventEmitter.Stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nodeState == NodeState.FirstRun)
|
||||||
|
{
|
||||||
|
studioEventEmitter.Play();
|
||||||
|
Task.SetSucceeded();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Stop(MyBT.NodeState nodeState)
|
||||||
|
{
|
||||||
|
if (nodeState == NodeState.Aborting)
|
||||||
|
{
|
||||||
|
studioEventEmitter.Stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nodeState == NodeState.FirstRun)
|
||||||
|
{
|
||||||
|
studioEventEmitter.Stop();
|
||||||
|
Task.SetSucceeded();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
[Header("FMod Support disabled: Window->MyBT->PreCompiler Definitions")]
|
[Header("FMod Support disabled: Window->MyBT->PreCompiler Definitions")]
|
||||||
public string dummy;
|
public string dummy;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -140,9 +140,6 @@ 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
|
||||||
|
|
Loading…
Reference in New Issue