Exemple #1
0
        float UnitToLumen(float value)
        {
            if (m_Unit == LightUnit.Lumen)
            {
                return(value);
            }

            // Punctual slider currently does not have any regard for spot shape/reflector.
            // Conversions need to happen as if light is a point, and this is the only setting that influences that.
            m_Light.enableSpotReflector.boolValue = false;

            return(HDLightUI.ConvertLightIntensity(m_Unit, LightUnit.Lumen, m_Light, m_Editor, value));
        }
Exemple #2
0
        float LumenToUnit(float value)
        {
            if (m_Unit == LightUnit.Lumen)
            {
                return(value);
            }

            // Once again temporarily disable reflector in case we called this for tooltip or context menu preset.
            m_Light.enableSpotReflector.boolValue = false;

            value = HDLightUI.ConvertLightIntensity(LightUnit.Lumen, m_Unit, m_Light, m_Editor, value);

            // Restore the state of spot reflector on the light.
            m_Light.enableSpotReflector.boolValue = m_SpotReflectorEnabled;

            return(value);
        }