|
|
|
|
|
|
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) |
|
|
|