浏览代码

[FIX] Fixed a bug where the master preview didn't update properly after a node got deleted and then undo-ed.

/main
Martin Thorzen 7 年前
当前提交
a4d567f1
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 6
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/PreviewManager.cs

6
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/PreviewManager.cs


m_TimeDependentPreviews.Add(node.tempId.index);
var masterNode = node as IMasterNode;
if (masterRenderData.shaderData == null && masterNode != null)
masterRenderData.shaderData = shaderData;
}

var renderData = Get(m_RenderDatas, nodeId);
if (renderData != null)
{
if (masterRenderData != null && masterRenderData.shaderData != null && masterRenderData.shaderData.node == renderData.shaderData.node)
masterRenderData.shaderData = m_RenderDatas.Where(x => x != null && x.shaderData.node is IMasterNode).Select(x => x.shaderData).FirstOrDefault();
// Check if we're destroying the shader data used by the master preview
if (masterRenderData != null && masterRenderData.shaderData != null && masterRenderData.shaderData == renderData.shaderData)
masterRenderData.shaderData = m_RenderDatas.Where(x => x != null && x.shaderData.node is IMasterNode && x != renderData).Select(x => x.shaderData).FirstOrDefault();
DestroyRenderData(renderData);

正在加载...
取消
保存