Beispiel #1
0
        internal void Init(TreeGraphView graphView, BehaviourTreeEditorr editor)
        {
            this.graphView = graphView;
            this.editor    = editor;

            indentationIcon = new Texture2D(1, 1);
            indentationIcon.SetPixel(0, 0, new Color(0, 0, 0, 0));
            indentationIcon.Apply();

            GetAllConnectionTypes();
        }
Beispiel #2
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);
                }
            }
        }
Beispiel #3
0
        internal override void Deserialize(List <NodeView> nodeViews, TreeGraphView graphView)
        {
            foreach (var serInputPort in NodeData.GetSerializedInputPorts())
            {
                if (serInputPort.outputPortNode == null || string.IsNullOrEmpty(serInputPort.outputPortName))
                {
                    continue;
                }

                NodeView connectToView = nodeViews.FirstOrDefault(nv => Equals(nv.GetNodeData(), serInputPort.outputPortNode));
                if (connectToView != null)
                {
                    LogicPort input  = GetPort(serInputPort.portName, this.inputContainer);
                    LogicPort output = GetPort(serInputPort.outputPortName, connectToView.outputContainer);
                    graphView.CreateEdge(input, output);
                }
            }
        }
 public static SaveBehaviourTreeUtility GetInstance(TreeGraphView graphView)
 {
     return(new SaveBehaviourTreeUtility(graphView));
 }
 private SaveBehaviourTreeUtility(TreeGraphView graphView)
 {
     this.graphView = graphView;
 }