Skip to content

Commit

Permalink
fix(audio): async bank loading on WebGL
Browse files Browse the repository at this point in the history
  • Loading branch information
FurkanKambay committed Aug 11, 2024
1 parent 25688ff commit 24c7007
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Assets/Code/Audio/WielderAudio.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections;
using FMOD.Studio;
using FMODUnity;
using SaintsField;
Expand All @@ -19,8 +20,11 @@ public class WielderAudio : MonoBehaviour

private PARAMETER_ID paramLifeState;

private void Awake()
private IEnumerator Start()
{
while (!RuntimeManager.HaveAllBanksLoaded)
yield return null;

EventDescription description = RuntimeManager.GetEventDescription(hurtEvent);
description.getParameterDescriptionByName("Life State", out PARAMETER_DESCRIPTION paramDesc);
paramLifeState = paramDesc.id;
Expand Down
6 changes: 5 additions & 1 deletion Assets/Code/Audio/WorldAudio.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections;
using FMOD.Studio;
using FMODUnity;
using Tulip.Data;
Expand All @@ -19,8 +20,11 @@ public class WorldAudio : MonoBehaviour
private PARAMETER_ID paramMaterial;
private PARAMETER_ID paramTerraformType;

private void Awake()
private IEnumerator Start()
{
while (!RuntimeManager.HaveAllBanksLoaded)
yield return null;

EventDescription description = RuntimeManager.GetEventDescription(tilePlacedEvent);

description.getParameterDescriptionByName("Material", out PARAMETER_DESCRIPTION paramDesc);
Expand Down

0 comments on commit 24c7007

Please sign in to comment.