浏览代码

Fix position or Node preview

/main
Tim Cooper 9 年前
当前提交
98e18802
共有 2 个文件被更改,包括 14 次插入17 次删除
  1. 8
      .gitignore
  2. 23
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/NodeDrawers/BaseMaterialNodeUI.cs

8
.gitignore


MaterialGraphProject/.vs
MaterialGraphProject/Library
MaterialGraphProject/MaterialGraphProject.CSharp.csproj
*.csproj
MaterialGraphProject/MaterialGraphProject.sln
MaterialGraphProject/MaterialGraphProject.CSharp.csproj
*.csproj
MaterialGraphProject/MaterialGraphProject.sln
MaterialGraphProject/Temp

23
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/NodeDrawers/BaseMaterialNodeUI.cs


}
}
private float m_PreviewWidth;
return kPreviewHeight;
}
if (!m_Node.drawState.expanded)
return 0;
protected virtual int previewWidth
{
get { return kPreviewWidth; }
}
protected virtual int previewHeight
{
get { return kPreviewHeight; }
m_PreviewWidth = width - 20;
return m_PreviewWidth;
}
public void SetNode(INode node)

public virtual GUIModificationType Render(Rect area)
{
if (m_Node == null)
if (m_Node == null || !m_Node.drawState.expanded)
return GUIModificationType.None;
if (m_LastShaderVersion != m_Node.version)

}
GUILayout.BeginHorizontal(GUILayout.MinWidth(previewWidth + 10), GUILayout.MinWidth(previewHeight + 10));
GUILayout.BeginArea(area);
GUILayout.BeginHorizontal(GUILayout.MinWidth(m_PreviewWidth + 10), GUILayout.MinWidth(m_PreviewWidth + 10));
var rect = GUILayoutUtility.GetRect(previewWidth, previewHeight, GUILayout.ExpandWidth(false));
var rect = GUILayoutUtility.GetRect(m_PreviewWidth, m_PreviewWidth, GUILayout.ExpandWidth(false));
var preview = RenderPreview(rect);
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();

GUILayout.EndArea();
return GUIModificationType.None;
}

正在加载...
取消
保存