I have a process running through my build process to build my game to the various platforms I am deploying to, and then upload the web player build to my web site. I’m trying to get this to be fully automated, but when Unity automatically recompiles my code it clears out all my static variables used in the process.
Realistically, the only static variable I need is an IEnumerator that records the process and the event registered to EditorApplication.update. Both of these seem to be cleared out by the script reloading.
I’ve been trying to use EditorApplication.LockReloadAssemblies to solve this, but it appears to have no affect. Halfway through my WWW upload the scripts finish reloading, the variables are cleared out, and I’m left with a half-filled upload progress bar.
Is there a solution to this? Can I fend off the automatic assembly reload?
I was able to solve this by testing for EditorApplication.isUpdating and EditorApplication.isCompiling. If either are true, then I wait before continuing on to the next phase of my build and publish process.