Issue with StreamingAssets copy when running Unity in batchmode

(James Ferguson) #1


I recently added the FMOD Studio Unity integration to our project and it has all been working great apart from one thing, our automated builds are missing all of the soundbanks.

Our project is set up to use the “Streaming Assets” import type, and is linked to the fmod project via the project file path. This all works correctly when running in the editor, switching platforms and making builds from the editor, in all of these cases the banks are copied over to StreamingAssets as expected.

Our automated build process runs Unity with the -batchmode commandline parameter and a custom build script executed via -executeMethod. It’s the batchmode parameter that seems to be what is causing the copy step to fail, the banks and StreamingAssets folder are missing from both the Assets directory and the build output in these builds. I’ve worked around this for now by calling FMODUnity.EventManager.UpdateCache() and FMODUnity.EventManager.CopyToStreamingAssets() from our build script before it makes the player build, but it seems like a bit of a hack. I think the issue is that the EditorApplication.Update event used in the EventManger script doesn’t seem to ever get triggered when running Unity in batchmode, so this copy step never runs as it usually would.

Is this a known issue? Is my workaround going to be sufficient to solve this?

ps. I’m running Unity 5.6.1p1 and Fmod integration 1.09.05, and the builds I’m making are all Win64 builds.


(Cameron Baron) #2

You are correct, because the editor doesn’t launch the Editor scripts don’t run.
We have only been made aware that this is an issue once before, and we came to the conclusion that manually calling UpdateCache & CopyToStreamingAssets (as you have suggested) is going to be required.

(James Ferguson) #3

Thanks Cameron, I’ll keep doing it this way then (seems to be holding up OK so far)

(Shervin) #4

Hey James, we seem to be running into the same problem, but it seems that on UpdateCache() it exits out because the countdownTimer is > 0 (countdownTimer == 3 specifically). So we’re left with no banks/without a streamingassets folder in our build. Did you run into this?