fmod / fmod-for-unity

FMOD Studio integration with Unity.
https://fmod.com/resources/documentation-unity
MIT License
181 stars 38 forks source link

FMODStudioCache causing deserialisation exceptions when Resource.LoadAll() is used in a build. #27

Closed peperbol closed 5 years ago

peperbol commented 5 years ago

Because the FMODStudioCache uses editor-only classes, it might cause errors if it is still present in a build, when unity tries to load and deserialize it. This could happen when a script uses Resources.LoadAll("").

A solution to this problem would be to move the FMOD studiocache into an Editor folder. So when looking at FMODUnity.EventManager in EventManager.cs changing the path on line 17 to: const string CacheAssetFullName = "Assets/Plugins/FMOD/Editor/Resources/" + CacheAssetName + ".asset"; would fix the issue. This will result in the asset not being included in a build.

fmod-cameron commented 5 years ago

Thank you very much for the input, I have raised a task to fix this in an upcoming release.