connect ports
This commit is contained in:
parent
7c14691132
commit
b7be961b5f
@ -1,9 +1,17 @@
|
|||||||
using UnityEditor.Experimental.GraphView;
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor.Experimental.GraphView;
|
||||||
|
using UnityEngine.UIElements;
|
||||||
|
|
||||||
namespace AsmdefGraph.Editor {
|
namespace AsmdefGraph.Editor {
|
||||||
public class AsmdefGraphView : GraphView {
|
public class AsmdefGraphView : GraphView {
|
||||||
public AsmdefGraphView() : base() {
|
public AsmdefGraphView() : base() {
|
||||||
AddElement(new AsmdefNode());
|
AddElement(new AsmdefNode());
|
||||||
|
AddElement(new AsmdefNode());
|
||||||
|
this.AddManipulator(new SelectionDragger());
|
||||||
|
}
|
||||||
|
|
||||||
|
public override List<Port> GetCompatiblePorts(Port startAnchor, NodeAdapter nodeAdapter) {
|
||||||
|
return ports.ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,14 @@
|
|||||||
|
|
||||||
namespace AsmdefGraph.Editor {
|
namespace AsmdefGraph.Editor {
|
||||||
public class AsmdefNode : Node {
|
public class AsmdefNode : Node {
|
||||||
|
public AsmdefNode() {
|
||||||
|
title = "AsmdefNode";
|
||||||
|
|
||||||
|
var inputPort = Port.Create<Edge>(Orientation.Horizontal, Direction.Input, Port.Capacity.Single, typeof(Port));
|
||||||
|
inputContainer.Add(inputPort);
|
||||||
|
|
||||||
|
var outputPort = Port.Create<Edge>(Orientation.Horizontal, Direction.Output, Port.Capacity.Single, typeof(Port));
|
||||||
|
outputContainer.Add(outputPort);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user