浏览代码

Merge pull request #1692 from Unity-Technologies/fix/update-version-HDRP-components

Fix/update version hdrp components
/main
GitHub 6 年前
当前提交
caba6f88
共有 3 个文件被更改,包括 50 次插入4 次删除
  1. 11
      com.unity.render-pipelines.high-definition/HDRP/Camera/HDAdditionalCameraData.cs
  2. 21
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/HDAdditionalReflectionData.cs
  3. 22
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/PlanarReflectionProbe.cs

11
com.unity.render-pipelines.high-definition/HDRP/Camera/HDAdditionalCameraData.cs


public class HDAdditionalCameraData : MonoBehaviour, ISerializationCallbackReceiver
{
[HideInInspector]
public float version = 1.0f;
const int currentVersion = 1;
[SerializeField, FormerlySerializedAs("version")]
int m_Version;
// The light culling use standard projection matrices (non-oblique)
// If the user overrides the projection matrix with an oblique one

// When FrameSettings are manipulated or RenderPath change we reset them to reflect the change, discarding all the Debug Windows change.
// Tag as dirty so frameSettings are correctly initialize at next HDRenderPipeline.Render() call
m_frameSettingsIsDirty = true;
if(m_Version != currentVersion)
{
// Add here data migration code
m_Version = currentVersion;
}
}
// This is called at the creation of the HD Additional Camera Data, to convert the legacy camera settings to HD

21
com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/HDAdditionalReflectionData.cs


using UnityEngine.Serialization;
using UnityEngine.Experimental.Rendering.HDPipeline;
using System;
public class HDAdditionalReflectionData : MonoBehaviour
public class HDAdditionalReflectionData : MonoBehaviour, ISerializationCallbackReceiver
public float version = 1.0f;
const int currentVersion = 1;
[SerializeField, FormerlySerializedAs("version")]
int m_Version;
public ShapeType influenceShape;
[FormerlySerializedAsAttribute("dimmer")]

public float sphereBlendRadiusOffset { get { return -blendDistancePositive.x; } }
public float sphereBlendNormalRadiusOffset { get { return -blendNormalDistancePositive.x; } }
public void OnBeforeSerialize()
{
}
public void OnAfterDeserialize()
{
if (m_Version != currentVersion)
{
// Add here data migration code
m_Version = currentVersion;
}
}
}
}

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;
}
}
}
}
正在加载...
取消
保存