I know there has been several posts, but I still can’t get the lightmaps immediately displayed on the screen. I use only one lightmap at one time, and the lightmap is updated and stored in the same name. I attach this script to the object which I baked the lightmaps to. Thanks very much!
public class RoomLightmap : MonoBehaviour {
private LightmapData[] lightmapdata = new LightmapData[1];
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
lightmapdata[0] = new LightmapData();
lightmapdata[0].lightmapFar = Resources.Load("Final_LightmapFar", typeof(Texture2D)) as Texture2D;
LightmapSettings.lightmaps = lightmapdata;
renderer.lightmapIndex = 0;
renderer.enabled = true;
}
}