public void show(SceneObject light) { currentLight = light; switch (sliderType) { case SliderType.INTENSITY: slider.MaxValue = float.MaxValue; slider.Sensitivity = VPETSettings.Instance.lightIntensityFactor / 20f; slider.Value = currentLight.getLightIntensity(); slider.Callback = this.updateIntensity; slider.gameObject.SetActive(true); break; case SliderType.RANGE: slider.MaxValue = float.MaxValue; slider.Sensitivity = 0.5f; slider.Value = currentLight.getLightRange(); slider.Callback = this.updateRange; slider.gameObject.SetActive(true); break; case SliderType.ANGLE: slider.MaxValue = 179f; slider.Sensitivity = 0.5f; slider.Value = currentLight.getLightAngle(); slider.Callback = this.updateAngle; slider.gameObject.SetActive(true); break; case SliderType.COLOR: colorWheel.gameObject.SetActive(true); colorWheel.Value = currentLight.getLightColor(); break; } /* * intensitySlider.gameObject.SetActive(true); * intensitySlider.Value = currentLight.getLightIntensity(); * if ( currentLight.isSpotLight || currentLight.isPointLight ) * { * rangeSlider.gameObject.SetActive(true); * rangeSlider.Value = currentLight.getLightRange(); * } * if ( currentLight.isSpotLight ) * { * angleSlider.gameObject.SetActive(true); * angleSlider.Value = currentLight.getLightAngle(); * } */ }
public void show(SceneObject light) { currentLight = light; if (sliderType == SliderType.COLOR) { colorWheel.gameObject.SetActive(true); colorWheel.Value = currentLight.getLightColor(); } else { colorWheel.gameObject.SetActive(false); } }