Open markvitapoly opened 6 years ago
Hi ! As this is not an officially supported unity workflow, I can't really ask for a fix on unity side. Storing right after build however works on SOME unity builds, but I believe in the latest ones it's consistently broken, so I am interested in providing a reliable workaround. I'll try what you suggest and see if I can make it work. Thanks for the suggestion
Just want to let you know that I was able to make it work with some hacks. I set some PlayerPref variables indicating that it's light building mode that triggered the play event. Then when in Play mode, it will wait a bit and then disable play mode updating the PlayerPref variables. In the editor script, I am also listening to EditorApplication.playModeStateChanged so I can catch when Unity stops playing and store the lightmaps. It'll continue to do this until all the lightmaps are finished.
It works, but it's pretty hacky. So, I think Unity core should officially support your project because using this project was how I got assetbundles to dynamically load lightmaps properly.
Trying a similar workaround ^^ if it works I'll put it in a branch. In the meantime I'll see if I can reproduce the bug with messed up lightmaps without using the script so I can report it.
Hi, I am using Unity 2017.2.0f3 and the lightmaps are messed up after baking. I see this comment:
I have a few lightmaps set up for a particular scene so I modified the script to build and store them all overnight. Is there a workaround to this existing issue? I've tired something like this:
Thanks!