浏览代码

Add changes according to PR feedback

/main
Jens Holm 7 年前
当前提交
fa558b34
共有 5 个文件被更改,包括 24 次插入19 次删除
  1. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/MasterPreviewView.cs
  2. 23
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GraphEditorView.cs
  3. 16
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Styles/MaterialGraph.uss
  4. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/MasterPreviewView.cs.meta
  5. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/MasterPreviewView.cs

4
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/MasterPreviewView.cs


namespace UnityEditor.ShaderGraph.Drawing.Inspector
{
public class MasterNodeView : VisualElement
public class MasterPreviewView : VisualElement
{
AbstractMaterialGraph m_Graph;

MasterNode m_MasterNode;
public MasterNodeView(string assetName, PreviewManager previewManager, AbstractMaterialGraph graph)
public MasterPreviewView(string assetName, PreviewManager previewManager, AbstractMaterialGraph graph)
{
m_Graph = graph;

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


MaterialGraphView m_GraphView;
GraphInspectorView m_GraphInspectorView;
MasterNodeView m_MasterNodeView;
MasterPreviewView m_MasterNodeView;
private EditorWindow m_EditorWindow;

m_GraphView.Add(m_GraphInspectorView);
m_MasterNodeView = new MasterNodeView(assetName, previewManager, graph) { name = "masterNodePreview" };
m_MasterNodeView = new MasterPreviewView(assetName, previewManager, graph) { name = "masterNodePreview" };
m_MasterNodeView.RegisterCallback<PostLayoutEvent>(UpdateSerializedWindowLayout);
m_FloatingWindowsLayoutKey = assetName + "_FloatingWindowsLayout";
m_FloatingWindowsLayoutKey = "FloatingWindowsLayout";
string serializedWindowLayout = EditorUserSettings.GetConfigValue(m_FloatingWindowsLayoutKey);
if (!String.IsNullOrEmpty(serializedWindowLayout))

}
}
void UpdateSerializedWindowLayout(PostLayoutEvent evt)
{
m_FLoatingWindowsLayout.inspectorLayout = m_GraphInspectorView.layout;
m_FLoatingWindowsLayout.previewLayout = m_MasterNodeView.layout;
string serializedWindowLayout = JsonUtility.ToJson(m_FLoatingWindowsLayout);
EditorUserSettings.SetConfigValue(m_FloatingWindowsLayoutKey, serializedWindowLayout);
}
public void Dispose()
{
onUpdateAssetClick = null;

Object.DestroyImmediate(m_SearchWindowProvider);
m_SearchWindowProvider = null;
}
m_FLoatingWindowsLayout.inspectorLayout = m_GraphInspectorView.layout;
m_FLoatingWindowsLayout.previewLayout = m_MasterNodeView.layout;
string serializedWindowLayout = JsonUtility.ToJson(m_FLoatingWindowsLayout);
EditorUserSettings.SetConfigValue(m_FloatingWindowsLayoutKey, serializedWindowLayout);
}
}
}

16
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Styles/MaterialGraph.uss


padding-bottom: 4;
}
MasterNodeView {
MasterPreviewView {
flex-direction: column;
position-type: absolute;
position-right: 0;

min-height: 200;
}
MasterNodeView > #top {
MasterPreviewView > #top {
MasterNodeView > #top > #title {
MasterPreviewView > #top > #title {
MasterNodeView > #top {
MasterPreviewView > #top {
padding-top: 8;
padding-bottom: 8;
padding-left: 8;

MasterNodeView > #middle {
MasterPreviewView > #middle {
MasterNodeView > #middle > #preview {
MasterPreviewView > #middle > #preview {
MasterNodeView > #bottom {
MasterPreviewView > #bottom {
background-color: rgb(79, 79, 79);
position-type: absolute;
position-bottom: 0;

padding-bottom: 12;
}
MasterNodeView > #bottom > #picker > ObjectFieldDisplay > Label {
MasterPreviewView > #bottom > #picker > ObjectFieldDisplay > Label {
font-size: 11;
}

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/MasterNodeView.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/MasterPreviewView.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/MasterNodeView.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/MasterPreviewView.cs

正在加载...
取消
保存