浏览代码

Merge pull request #195 from Unity-Technologies/fix-ondisposed-empty-shadergraph

[FIX] Fixed an issue where openening up an empty shadergraph without …
/main
GitHub 7 年前
当前提交
f59e7806
共有 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;

正在加载...
取消
保存