diff --git a/Assets/AsmdefGraph/Editor/AsmdefGraphView.cs b/Assets/AsmdefGraph/Editor/AsmdefGraphView.cs index 4522780..b26891d 100644 --- a/Assets/AsmdefGraph/Editor/AsmdefGraphView.cs +++ b/Assets/AsmdefGraph/Editor/AsmdefGraphView.cs @@ -1,9 +1,17 @@ -using UnityEditor.Experimental.GraphView; +using System.Collections.Generic; +using UnityEditor.Experimental.GraphView; +using UnityEngine.UIElements; namespace AsmdefGraph.Editor { public class AsmdefGraphView : GraphView { public AsmdefGraphView() : base() { AddElement(new AsmdefNode()); + AddElement(new AsmdefNode()); + this.AddManipulator(new SelectionDragger()); + } + + public override List GetCompatiblePorts(Port startAnchor, NodeAdapter nodeAdapter) { + return ports.ToList(); } } } diff --git a/Assets/AsmdefGraph/Editor/AsmdefNode.cs b/Assets/AsmdefGraph/Editor/AsmdefNode.cs index d679ce9..de87533 100644 --- a/Assets/AsmdefGraph/Editor/AsmdefNode.cs +++ b/Assets/AsmdefGraph/Editor/AsmdefNode.cs @@ -2,6 +2,14 @@ namespace AsmdefGraph.Editor { public class AsmdefNode : Node { + public AsmdefNode() { + title = "AsmdefNode"; + var inputPort = Port.Create(Orientation.Horizontal, Direction.Input, Port.Capacity.Single, typeof(Port)); + inputContainer.Add(inputPort); + + var outputPort = Port.Create(Orientation.Horizontal, Direction.Output, Port.Capacity.Single, typeof(Port)); + outputContainer.Add(outputPort); + } } }