浏览代码

[FIX] Fixed an issue where openening up an empty shadergraph without any nodes caused an error.

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

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


void DestroyRenderData(PreviewRenderData renderData)
{
if (renderData.shaderData.shader != null && renderData.shaderData.shader != m_UberShader)
if (renderData.shaderData != null
&& renderData.shaderData.shader != null
&& renderData.shaderData.shader != m_UberShader)
var node = renderData.shaderData.node;
if (node != null)
node.onModified -= OnNodeModified;
if (renderData.shaderData != null && renderData.shaderData.node != null)
renderData.shaderData.node.onModified -= OnNodeModified;
}
void DestroyPreview(Identifier nodeId)

6
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GraphEditorView.cs


public void Dispose()
{
saveRequested = null;
convertToSubgraphRequested = null;
showInProjectRequested = null;
saveRequested = null;
convertToSubgraphRequested = null;
showInProjectRequested = null;
foreach (var node in m_GraphView.Children().OfType<MaterialNodeView>())
node.Dispose();
m_GraphView = null;

正在加载...
取消
保存