I’m having a problem where the lightmap information is correctly assigned to the objects in edit mode, but in play mod it loses the lightmap uv’s for all the objects except the terrain, how can I solve this problem?
Also, the project uses a script (below) that changes the LightingDataAsset during play, how does this affect the light map uv?
void SetInitialEnvironment()
{
RenderSettings.skybox = isDay ? daySkybox : nightSkybox;
Lightmapping.lightingDataAsset = isDay ? lightingDataDay : lightingDataNight;
dayLight.enabled = isDay;
nightLight.enabled = !isDay;
RenderSettings.sun = isDay ? dayLight : nightLight;
foreach (GameObject obj in dayObjects)
{
obj.SetActive(isDay);
}
foreach (GameObject obj in nightObjects)
{
obj.SetActive(!isDay);
}
if (isDay)
{
nightSound.Stop();
daySound.Play();
}
else
{
daySound.Stop();
nightSound.Play();
}
DynamicGI.UpdateEnvironment();
}
Thanks in advance for any help.