卸载银行 destroy/release 该银行中的所有实例

Does unloading a bank destroy/release all instances in that bank

以卸载银行作为释放所有相关实例的方式是否安全?我是 FMOD 的新手,正在努力了解自己的方位。

我在 Unity 中跨场景播放音乐,所以我想知道我是否应该担心保留实例,或者只是卸载银行。

引用自FMOD Studio API guide

If the bank containing the sample data was loaded via Studio::System::loadBankMemory then the system must immediately unload sample data when the bank is unloaded. This may lead to playback errors if any instances of events in the bank are still playing. This can occur even if multiple copies of the sample data are loaded from different banks and only one of the copies is being unloaded.

因此,基本上,如果您通过 Fmod API 的 Unity 集成包显式加载库,则必须小心卸载库,因为它可能会产生不需要的行为和空引用。但是如果你正在做一个特定的场景,比如在场景卸载时卸载银行,并且你绝对确定没有任何实例会引用银行,我看不出不这样做的理由。 此外,fmod 的 unity 集成提供了银行加载和卸载的事件触发器。看看这个:Studio Bank Loader