浏览代码

merge with HDRP/refactor-reflectionProbe/merge-probe-editors

/main
RSlysz 6 年前
当前提交
f7a8cc05
共有 3 个文件被更改,包括 12 次插入0 次删除
  1. 5
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/SerializedHDReflectionProbe.cs
  2. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/SerializedPlanarReflectionProbe.cs
  3. 5
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/PlanarReflectionProbe.cs

5
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/SerializedHDReflectionProbe.cs


internal SerializedProperty legacyBlendDistance;
internal SerializedProperty boxSize;
internal SerializedProperty boxOffset;
internal SerializedProperty legacyMode;
internal new HDAdditionalReflectionData target { get { return serializedObject.targetObject as HDAdditionalReflectionData; } }
internal ReflectionProbe targetLegacy { get { return serializedLegacyObject.targetObject as ReflectionProbe; } }

nearClip = legacyProbe.FindProperty("m_NearClip");
farClip = legacyProbe.FindProperty("m_FarClip");
legacyBlendDistance = legacyProbe.FindProperty("m_BlendDistance");
legacyMode = legacyProbe.FindProperty("m_Mode");
}
internal override void Update()

internal override void Apply()
{
//sync size
switch(target.influenceVolume.shape)
{
case InfluenceShape.Box:

boxSize.vector3Value = Vector3.one * influenceVolume.sphereRadius.floatValue;
break;
}
// Sync mode
legacyMode.intValue = mode.intValue;
serializedLegacyObject.ApplyModifiedProperties();
serializedObject.ApplyModifiedProperties();
}

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/SerializedPlanarReflectionProbe.cs


overrideFieldOfView = serializedObject.Find((PlanarReflectionProbe p) => p.overrideFieldOfView);
fieldOfViewOverride = serializedObject.Find((PlanarReflectionProbe p) => p.fieldOfViewOverride);
influenceVolume.editorSimplifiedModeBlendNormalDistance.floatValue = 0;
}

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


using UnityEngine.Serialization;
using UnityEngine.Rendering;
using UnityEngine.Assertions;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{

public void OnAfterDeserialize()
{
Assert.IsNotNull(influenceVolume, "influenceVolume must have an instance at this point. See HDProbe.Awake()");
if (m_Version != currentVersion)
{
// Add here data migration code

}
m_Version = currentVersion;
}
influenceVolume.boxBlendNormalDistanceNegative = Vector3.zero;
influenceVolume.boxBlendNormalDistancePositive = Vector3.zero;
}
}
}
正在加载...
取消
保存