浏览代码

HDRP: Add more comment to the workaorund for light upgrade

/main
sebastien lagarde 6 年前
当前提交
cbe3ad9e
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Light/HDAdditionalLightData.cs

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


// If we are deserializing an old version, convert the light intensity to the new system
if (version <= 1.0f)
{
// Note: We can't access to the light component in OnAfterSerialize as it is not init() yet,
// so instead we use a boolean to do the upgrade in OnEnable().
// However if the light is not enabled, the light is not upgraded.
// To solve this issue we add a callback below that will force OnEnable() to upgrade the light.
#if UNITY_EDITOR
EditorApplication.update += EditorOnEnableWorkaround;
#endif

}
#if UNITY_EDITOR
// See comment above, this is a workaround to upgrade Disabled light correctly.
void EditorOnEnableWorkaround()
{
OnEnable();

正在加载...
取消
保存