Hi,
i would like to change the “lightmappingMode” of a directional light in runtime. I am using Unity 5.5.0p3 at the moment and targeting android.
I have tried something like this:
public class LightmappingModeSwitch : MonoBehaviour {
public Light light;
void Start ()
{
if (SettingsManager.instance.someBoolean) {
light.lightmappingMode = LightmappingMode.Mixed;
} else {
light.lightmappingMode = LightmappingMode.Baked;
}
}
}
For some reason this is working on editor with this error:
Loading script assembly “Library/ScriptAssemblies/Assembly-CSharp-Editor-firstpass.dll” failed!
When trying to build for android i am getting this error:
error CS1061: Type UnityEngine.Light' does not contain a definition for lightmappingMode’ and no extension method lightmappingMode' of type UnityEngine.Light’ could be found. Are you missing an assembly reference?
Any help or another approach would be great.
Thanks!