public DecoratorTaskView(DecoratorTask nodeData, Vector2 position) : base(nodeData, position) { base.CreateFlowPort(Direction.Input, Capacity.Single); outputPort = base.CreateFlowPort(Direction.Output, Capacity.Single); RefreshExpandedState(); RefreshPorts(); }
public RootTaskView(RootTask nodeData, Vector2 position) : base(nodeData, position) { outputPort = base.CreateFlowPort(Direction.Output, Port.Capacity.Single); this.capabilities &= ~Capabilities.Deletable; RefreshExpandedState(); RefreshPorts(); }
internal override void Deserialize(List <NodeView> nodeViews, TreeGraphView graphView) { base.Deserialize(nodeViews, graphView); if (NodeData.Child != null) { NodeView connectToView = nodeViews.FirstOrDefault(nv => Equals(nv.GetNodeData(), NodeData.Child)); if (connectToView != null) { FlowPort input = GetFlowPort(Direction.Input, connectToView); FlowPort output = GetFlowPort(Direction.Output, this); graphView.CreateEdge(input, output); } } }
internal FlowPort CreateFlowPort(Direction direction, Capacity capacity) { FlowPort portView = new FlowPort(NodeData, direction, capacity); if (direction == Direction.Input) { this.Insert(0, portView); } else { mainContainer.Add(portView); } return(portView); }