Hi. I am learning how to use Fmod banks in Unity. In my previous projects, I’ve only been using one single master bank, so this is the first time I have to optimize my banks loading/unloading.
So I have a prefab “AudioManager” with a StudioBankLoader component on it. This component loads the master bank on start and unload it on destroy. I have another prefab called “Player” on which I placed another StudioBankLoader component, loading the player bank on enable and unloading it on disable.
I noticed that when the player is disabled, the Fmod events associated with the bank are still playing. I tried to disable the player bank component before restarting the game, the player events are still playing. I tried to disable the audio manager bearing the master bank and then restart, and every events are still playing.
I am getting a bit confused and I guess I missed something pretty important on how fmod banks works. Does someone could explain to me what’s happening ?
Edit : Since I posted, I tried two things. First I checked the loading state of each banks using HasBankLoaded(), they are all loaded on start, as expected, but my player bank doesn’t unload on disable.
public void OnDisable()
{
playerControls.Disable();
//Stop Player Event
playerFmodEvent.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
playerFmodEventInstance.release();
//Unload Player's Bank On Disable
foreach (var Player in studioBankLoader.Banks)
{
RuntimeManager.UnloadBank(Player);
}
}
Second, I tried to mess with the Initialization settings from the fmod setting tab. I switched the “Load Banks” menu from All to None. There, when I hit play, there is no sound playing but the Console still tell me that the two banks are loaded, even if there is no sound playing and I get a whole bunch of error “FMOD event missing”.