- Home /
assetbuldle with lightmap
hi~ how can i use assetbundle or resorces.load with lightmap(beast)??
if i use lightmap(beast) with resources.load or assetbundle. it's not working. lightmap(beast) is gone..
Answer by KvanteTore · Oct 05, 2011 at 12:12 PM
Lightmaps are global to the scene (depending on the lights in the scene as well as other objects) and not per object. However you can find the generated lightmaps exrs for a scene, and add them manually to your assetbundle or Resources folder.
You can then load the lightmaps at runtime and manually add the lightmap to LightmapSettings.lighttmaps and set the lightmapIndex on the renderer in question to the corresponding index in LightmapSettings.lightmaps, which will enable lightmap lighting for that renderer.
How exactly do you set the LightmapSettings.lightmaps on runtime? When I set it in a c# script it remains null.