예제 #1
0
        public DecoratorTaskView(DecoratorTask nodeData, Vector2 position) : base(nodeData, position)
        {
            base.CreateFlowPort(Direction.Input, Capacity.Single);
            outputPort = base.CreateFlowPort(Direction.Output, Capacity.Single);

            RefreshExpandedState();
            RefreshPorts();
        }
예제 #2
0
        public RootTaskView(RootTask nodeData, Vector2 position) : base(nodeData, position)
        {
            outputPort = base.CreateFlowPort(Direction.Output, Port.Capacity.Single);

            this.capabilities &= ~Capabilities.Deletable;

            RefreshExpandedState();
            RefreshPorts();
        }
예제 #3
0
        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);
                }
            }
        }
예제 #4
0
        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);
        }