@@ -214,13 +214,7 @@ internal enum PointLightHDType
214
214
internal PointLightHDType pointLightHDType
215
215
{
216
216
get => m_PointlightHDType ;
217
- set
218
- {
219
- if ( lightEntity . valid )
220
- {
221
- HDLightRenderDatabase . instance . GetShadowRequestUpdateInfoAsRef ( lightEntity ) . pointLightHDType = m_PointlightHDType ;
222
- }
223
- }
217
+ set => HDLightRenderDatabase . instance . SetPointLightType ( lightEntity , m_PointlightHDType ) ;
224
218
}
225
219
226
220
// Only for Spotlight, should be hide for other light
@@ -256,17 +250,17 @@ public HDLightType type
256
250
case HDLightType . Directional :
257
251
legacyLight . type = LightType . Directional ;
258
252
m_PointlightHDType = PointLightHDType . Punctual ;
259
- HDLightRenderDatabase . instance . EditLightDataAsRef ( lightEntity ) . pointLightType = m_PointlightHDType ;
253
+ HDLightRenderDatabase . instance . SetPointLightType ( lightEntity , m_PointlightHDType ) ;
260
254
break ;
261
255
case HDLightType . Spot :
262
256
legacyLight . type = LightType . Spot ;
263
257
m_PointlightHDType = PointLightHDType . Punctual ;
264
- HDLightRenderDatabase . instance . EditLightDataAsRef ( lightEntity ) . pointLightType = m_PointlightHDType ;
258
+ HDLightRenderDatabase . instance . SetPointLightType ( lightEntity , m_PointlightHDType ) ;
265
259
break ;
266
260
case HDLightType . Point :
267
261
legacyLight . type = LightType . Point ;
268
262
m_PointlightHDType = PointLightHDType . Punctual ;
269
- HDLightRenderDatabase . instance . EditLightDataAsRef ( lightEntity ) . pointLightType = m_PointlightHDType ;
263
+ HDLightRenderDatabase . instance . SetPointLightType ( lightEntity , m_PointlightHDType ) ;
270
264
break ;
271
265
case HDLightType . Area :
272
266
ResolveAreaShape ( ) ;
@@ -302,15 +296,13 @@ public SpotLightShape spotLightShape
302
296
return ;
303
297
304
298
m_SpotLightShape = value ;
305
- HDLightRenderDatabase . instance . EditLightDataAsRef ( lightEntity ) . spotLightShape = m_SpotLightShape ;
299
+ HDLightRenderDatabase . instance . SetSpotLightShape ( lightEntity , m_SpotLightShape ) ;
306
300
307
301
// If the current light unit is not supported by this spot light shape, we change it
308
302
var supportedUnits = GetSupportedLightUnits ( type , value ) ;
309
303
if ( ! supportedUnits . Any ( u => u == lightUnit ) )
310
304
lightUnit = supportedUnits . First ( ) ;
311
305
UpdateAllLightValues ( ) ;
312
-
313
- HDLightRenderDatabase . instance . GetShadowRequestUpdateInfoAsRef ( lightEntity ) . spotLightShape = m_SpotLightShape ;
314
306
}
315
307
}
316
308
@@ -326,20 +318,21 @@ public AreaLightShape areaLightShape
326
318
return ;
327
319
328
320
m_AreaLightShape = value ;
329
- HDLightRenderDatabase . instance . EditLightDataAsRef ( lightEntity ) . areaLightShape = m_AreaLightShape ;
321
+ HDLightRenderDatabase . instance . SetAreaLightShape ( lightEntity , m_AreaLightShape ) ;
330
322
331
323
if ( type == HDLightType . Area )
332
324
ResolveAreaShape ( ) ;
333
325
UpdateAllLightValues ( ) ;
334
326
335
- HDLightRenderDatabase . instance . GetShadowRequestUpdateInfoAsRef ( lightEntity ) . areaLightShape = m_AreaLightShape ;
327
+
336
328
}
337
329
}
338
330
339
331
void ResolveAreaShape ( )
340
332
{
341
333
m_PointlightHDType = PointLightHDType . Area ;
342
- HDLightRenderDatabase . instance . EditLightDataAsRef ( lightEntity ) . pointLightType = m_PointlightHDType ;
334
+ HDLightRenderDatabase . instance . SetPointLightType ( lightEntity , m_PointlightHDType ) ;
335
+
343
336
if ( areaLightShape == AreaLightShape . Disc )
344
337
{
345
338
legacyLight . type = LightType . Disc ;
@@ -526,7 +519,7 @@ internal HDLightType ComputeLightType(Light attachedLight)
526
519
{
527
520
legacyLight . type = LightType . Point ;
528
521
m_PointlightHDType = PointLightHDType . Area ;
529
- HDLightRenderDatabase . instance . EditLightDataAsRef ( lightEntity ) . pointLightType = m_PointlightHDType ;
522
+ HDLightRenderDatabase . instance . SetPointLightType ( lightEntity , m_PointlightHDType ) ;
530
523
531
524
m_AreaLightShape = AreaLightShape . Rectangle ;
532
525
0 commit comments