浏览代码

Fix bug causing preview to be now shown after creating a node

/main
Peter Bay Bastian 7 年前
当前提交
fe10dc56
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 8
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/MaterialNodeView.cs

8
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/MaterialNodeView.cs


void UpdatePreviewTexture()
{
if (m_PreviewRenderData.texture == null || !node.previewExpanded || m_PreviewTextureView.panel == null)
if (m_PreviewRenderData.texture == null || !node.previewExpanded)
{
m_PreviewTextureView.visible = false;
m_PreviewTextureView.image = Texture2D.blackTexture;

m_PreviewTextureView.visible = true;
m_PreviewTextureView.AddToClassList("visible");
m_PreviewTextureView.RemoveFromClassList("hidden");
m_PreviewTextureView.image = m_PreviewRenderData.texture;
m_PreviewTextureView.Dirty(ChangeType.Repaint);
if (m_PreviewTextureView.image != m_PreviewRenderData.texture)
m_PreviewTextureView.image = m_PreviewRenderData.texture;
else
m_PreviewTextureView.Dirty(ChangeType.Repaint);
}
}

正在加载...
取消
保存