@@ -39,13 +39,13 @@ public void UpdateLight(Light light, LightData data, bool isInsert)
3939 // color and position
4040 hdLight . color = data . Color2 . ToUnityColor ( ) ;
4141 if ( ! isInsert ) {
42- hdLight . intensity = data . Intensity / 4f ;
42+ light . intensity = data . Intensity / 4f ;
4343 hdLight . range = data . Falloff * 0.001f ;
4444
4545 // TODO: vpe specific data for height
4646 light . transform . localPosition = new Vector3 ( 0f , 0f , 25f ) ;
4747 } else {
48- hdLight . intensity = data . Intensity * 10f ;
48+ light . intensity = data . Intensity * 10f ;
4949 }
5050
5151
@@ -78,10 +78,8 @@ public void SetRange(Light light, float range)
7878
7979 public void SetIntensity ( Light light , float intensityLumen )
8080 {
81- var hdLight = light . GetComponent < HDAdditionalLightData > ( ) ;
82- if ( hdLight != null ) {
83- hdLight . SetIntensity ( intensityLumen , LightUnit . Lumen ) ;
84- }
81+ light . intensity = intensityLumen ;
82+ light . lightUnit = UnityEngine . Rendering . LightUnit . Lumen ;
8583 }
8684 public void SetTemperature ( Light light , float temperature )
8785 {
@@ -93,18 +91,16 @@ public void SetTemperature(Light light, float temperature)
9391
9492 public void SpotLight ( Light light , float outer , float innerPercent )
9593 {
96- var hdLight = light . GetComponent < HDAdditionalLightData > ( ) ;
97- if ( hdLight != null ) {
98- hdLight . type = HDLightType . Spot ;
99- hdLight . SetSpotAngle ( outer , innerPercent ) ;
100- }
94+ light . type = LightType . Spot ;
95+ light . spotAngle = outer ;
96+ light . innerSpotAngle = innerPercent ;
10197 }
10298
10399 public void PyramidAngle ( Light light , float angle , float aspectRatio )
104100 {
105101 var hdLight = light . GetComponent < HDAdditionalLightData > ( ) ;
106102 if ( hdLight != null ) {
107- hdLight . spotLightShape = SpotLightShape . Pyramid ;
103+ // hdLight.spotLightShape = SpotLightShape.Pyramid;
108104 hdLight . SetSpotAngle ( angle ) ;
109105 hdLight . aspectRatio = aspectRatio ;
110106 }
0 commit comments