浏览代码

update PlanarReflectionProbe version handling

/main
RSlysz 6 年前
当前提交
b6807743
共有 1 个文件被更改,包括 21 次插入1 次删除
  1. 22
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/PlanarReflectionProbe.cs

22
com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/PlanarReflectionProbe.cs


using UnityEngine.Serialization;
using UnityEngine.Rendering;
using System;
public class PlanarReflectionProbe : MonoBehaviour
public class PlanarReflectionProbe : MonoBehaviour, ISerializationCallbackReceiver
[HideInInspector]
const int currentVersion = 1;
[SerializeField, FormerlySerializedAs("version")]
int m_Version;
public enum CapturePositionMode
{
Static,

if (isActiveAndEnabled)
ReflectionSystem.RegisterProbe(this);
}
public void OnBeforeSerialize()
{
}
public void OnAfterDeserialize()
{
if (m_Version != currentVersion)
{
// Add here data migration code
m_Version = currentVersion;
}
}
}
}
正在加载...
取消
保存