Skip to content

Commit c5512e4

Browse files
committed
api: Add range.
1 parent 3de0313 commit c5512e4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Runtime/LightConverter.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ public void SetShadow(Light light, bool enabled, bool isDynamic, float nearPlane
6565
hdLight.SetShadowUpdateMode(isDynamic ? ShadowUpdateMode.EveryFrame : ShadowUpdateMode.OnEnable);
6666
}
6767
}
68+
public void SetRange(Light light, float range)
69+
{
70+
var hdLight = light.GetComponent<HDAdditionalLightData>();
71+
if (hdLight != null) {
72+
hdLight.range = range;
73+
}
74+
}
6875

6976
public void SetIntensity(Light light, float intensityLumen)
7077
{
@@ -85,6 +92,7 @@ public void SpotLight(Light light, float outer, float innerPercent)
8592
{
8693
var hdLight = light.GetComponent<HDAdditionalLightData>();
8794
if (hdLight != null) {
95+
hdLight.type = HDLightType.Spot;
8896
hdLight.SetSpotAngle(outer, innerPercent);
8997
}
9098
}

0 commit comments

Comments
 (0)