Short question: How do I programmatically swap at runtime the LightmapSnapshot asset?
Background:
I’m working on a project that uses a set of scenes and hides or shows different objects based on what in-game day is being played. Since the objects that were being hidden or shown didn’t move around, we marked them as lightmap static and were able to bake lighting in Unity 4 on those objects. We had a full build system set up to manually cache off the lightmap index, tiling, and offset values during bake time and re-populate those values at runtime after loading in the scene.
From what I can tell from other forum posts, the LightmapSnapshot object contains all this information now (which is great), but the only method I can use to get to the current snapshot is by using reflection and serialized properties and I haven’t found a way to assign the asset at runtime (not great). In editor I tried assigning the LightmapSnapshot after loading into the scene and it didn’t seem to do anything, so I’m assuming this might be part of the level load stage, but it also seems like there should be a function I can call to load the snapshot.
If anyone has any thoughts on how to swap this at runtime, I would greatly appreciate the help!