public MyNode(MyGraphView graph, Vector2 pos) : base() { m_graph = graph; SetPosition(new Rect(pos, GetPosition().size)); //layout = new Rect(pos, size); this.AddManipulator(new Dragger()); AddPort(Orientation.Horizontal, Direction.Input); AddPort(Orientation.Horizontal, Direction.Output); AddPort(Orientation.Horizontal, Direction.Output); AddPort(Orientation.Horizontal, Direction.Output); }
public void OnEnable() { var root = this.GetRootVisualContainer(); m_graph = new MyGraphView(this); m_graph.RegisterCallback <KeyDownEvent>(OnSpaceDown); m_graph.AddManipulator(new ContentDragger()); m_graph.AddManipulator(new RectangleSelector()); //graph.AddManipulator(new SelectionDragger()); m_graph.AddNode(new MyNode(m_graph, Vector2.zero)); root.Add(m_graph); }
public MyEdgeConnectorListener(MyGraphView graph) { m_graph = graph; }