浏览代码

Make graph inspector window not pinned to the right side of the editor window

/main
Jens Holm 7 年前
当前提交
22adea01
共有 2 个文件被更改,包括 15 次插入1 次删除
  1. 11
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GraphEditorView.cs
  2. 5
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Styles/MaterialGraph.uss

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


content.Add(m_GraphView);
m_GraphInspectorView = new GraphInspectorView(assetName, previewManager, graph) { name = "inspector" };
m_GraphInspectorView.AddManipulator(new Draggable(OnMouseDrag, true));
content.Add(m_GraphInspectorView);
m_GraphView.Add(m_GraphInspectorView);
m_GraphView.graphViewChanged = GraphViewChanged;
}

AddEdge(edge);
Add(content);
}
void OnMouseDrag(Vector2 mouseDelta)
{
Vector2 normalizedDelta = mouseDelta / 2f;
m_GraphInspectorView.style.positionRight -= normalizedDelta.x;
m_GraphInspectorView.style.positionBottom -= normalizedDelta.y;
}
GraphViewChange GraphViewChanged(GraphViewChange graphViewChange)

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


background-color: rgb(56, 56, 56);
flex-direction: column;
justify-content: space-between;
position-type: absolute;
position-right: 0;
position-bottom: 0;
width: 400;
height: 800;
}
GraphInspectorView > #top > #header {

正在加载...
取消
保存