Ayfel / PrefabLightmapping

Script for saving lightmapping data to prefabs. Used through the Assets tab in Unity. Place your prefbas in the scene with this script at the root. Set up your lighting and in the editor go to Assets->Bake Prefab Lightmaps. After is processed you can now spawn your prefabs in different scenes and they will use the lightmapping from the original scene.
624 stars 89 forks source link

Lightmap not used after applying to prefab #15

Closed BGDaan closed 3 years ago

BGDaan commented 3 years ago

I'm having some trouble using this. After baking my lights when I do the Assets > Bake Prefab Lightmaps everything seems to be going well. The script on the prefab is being populated.

But then when I look into the prefab, everything is unlit again. It's not being applied. And going back to the scene everything is gone as well. Do you have any insights on this issue?

I'm working on Unity 2019.2.9f1.

Telroshan commented 3 years ago

I guess it's only applied on Awake and scene loaded, at runtime (play mode) @Ayfel I wonder if adding a ExecuteAlways tag to make it happen in Editor & Prefab Mode as well would have any drawback ?

BGDaan commented 3 years ago

You are right. It works. Thank you for clearing that up :)

Ayfel commented 3 years ago

Yes you are right about that, I dont think there is any drawback, so I might add that in the next commit, thanks : )