浏览代码

[PlanarReflection] Fixed crash on PlanarReflectionProbe Add

/main
Frédéric Vauchelles 7 年前
当前提交
a36e540f
共有 3 个文件被更改,包括 18 次插入7 次删除
  1. 19
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/SerializedPlanarReflectionProbe.cs
  2. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/Volume/ProxyVolumeUI.cs
  3. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/Volume/ReflectionProxyVolumeComponentUI.cs

19
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/SerializedPlanarReflectionProbe.cs


{
var objs = new List<Object>();
for (var i = 0; i < serializedObject.targetObjects.Length; i++)
objs.Add(((PlanarReflectionProbe)serializedObject.targetObjects[i]).proxyVolumeReference);
reflectionProxyVolume = new SerializedReflectionProxyVolumeComponent(new SerializedObject(objs.ToArray()));
{
var p = ((PlanarReflectionProbe)serializedObject.targetObjects[i]).proxyVolumeReference;
if (p != null)
objs.Add(p);
}
reflectionProxyVolume = objs.Count > 0
? new SerializedReflectionProxyVolumeComponent(new SerializedObject(objs.ToArray()))
: null;
}
public void Update()

var updateProxyVolume = serializedObject.targetObjects.Length != reflectionProxyVolume.serializedObject.targetObjects.Length;
if (!updateProxyVolume)
var updateProxyVolume = reflectionProxyVolume != null
&& serializedObject.targetObjects.Length != reflectionProxyVolume.serializedObject.targetObjects.Length;
if (!updateProxyVolume && reflectionProxyVolume != null)
{
var proxyVolumeTargets = reflectionProxyVolume.serializedObject.targetObjects;
for (var i = 0; i < serializedObject.targetObjects.Length; i++)

public void Apply()
{
serializedObject.ApplyModifiedProperties();
reflectionProxyVolume.Apply();
if (reflectionProxyVolume != null)
reflectionProxyVolume.Apply();
}
}
}

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/Volume/ProxyVolumeUI.cs


public override void Update()
{
base.Update();
SetIsSectionExpanded_Shape((ShapeType)data.shapeType.intValue);
if (data != null)
SetIsSectionExpanded_Shape((ShapeType)data.shapeType.intValue);
}
void SetIsSectionExpanded_Shape(ShapeType shape)

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/Volume/ReflectionProxyVolumeComponentUI.cs


public override void Reset(SerializedReflectionProxyVolumeComponent data, UnityAction repaint)
{
proxyVolume.Reset(data.proxyVolume, repaint);
if (data != null)
proxyVolume.Reset(data.proxyVolume, repaint);
base.Reset(data, repaint);
}

正在加载...
取消
保存