void SetLightIntensity(float intensity) { displayLightIntensity = intensity; if (lightUnit == LightUnit.Lumen) { if (lightTypeExtent == LightTypeExtent.Punctual) SetLightIntensityPunctual(intensity); else legacyLight.intensity = LightUtils.ConvertAreaLightLumenToLuminance(lightTypeExtent, intensity, shapeWidth, shapeHeight); } else if (lightUnit == LightUnit.Ev100) { legacyLight.intensity = LightUtils.ConvertEvToLuminance(intensity); } else if ((legacyLight.type == LightType.Spot || legacyLight.type == LightType.Point) && lightUnit == LightUnit.Lux) { // Box are local directional light with lux unity without at distance if ((legacyLight.type == LightType.Spot) && (spotLightShape == SpotLightShape.Box)) legacyLight.intensity = intensity; else legacyLight.intensity = LightUtils.ConvertLuxToCandela(intensity, luxAtDistance); } else legacyLight.intensity = intensity; #if UNITY_EDITOR legacyLight.SetLightDirty(); // Should be apply only to parameter that's affect GI, but make the code cleaner #endif }