浏览代码

Light unit upgrade workaround

/main
Antoine Lelievre 6 年前
当前提交
f32756be
共有 1 个文件被更改,包括 13 次插入2 次删除
  1. 15
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Light/HDAdditionalLightData.cs

15
com.unity.render-pipelines.high-definition/HDRP/Lighting/Light/HDAdditionalLightData.cs


// This structure contains all the old values for every recordable fields from the HD light editor
// so we can force timeline to record changes on other fields from the LateUpdate function (editor only)
struct TimelineWorkaournd
struct TimelineWorkaround
{
public float oldDisplayLightIntensity;
public float oldSpotAngle;

#if UNITY_EDITOR
// We need these old states to make timeline and the animator record the intensity value and the emissive mesh changes (editor-only)
[System.NonSerialized]
TimelineWorkaournd timelineWorkaround;
TimelineWorkaround timelineWorkaround;
#endif
// For light that used the old intensity system we update them

// If we are deserializing an old version, convert the light intensity to the new system
if (version <= 1.0f)
{
#if UNITY_EDITOR
EditorApplication.update += EditorOnEnableWorkaround;
#endif
#if UNITY_EDITOR
void EditorOnEnableWorkaround()
{
OnEnable();
EditorApplication.update -= EditorOnEnableWorkaround;
}
#endif
private void OnEnable()
{

正在加载...
取消
保存