public TreeGraphView(BehaviourTreeEditorr editor, VisualElement inspectorContainer)
        {
            this.editor             = editor;
            this.inspectorContainer = inspectorContainer;

            name = "BehaviourTreeGraph";

            SetupZoom(ContentZoomer.DefaultMinScale, ContentZoomer.DefaultMaxScale);

            this.AddManipulator(new ContentDragger());
            this.AddManipulator(new SelectionDragger());
            this.AddManipulator(new RectangleSelector());

            //styleSheets.Add(Resources.Load<StyleSheet>("LSMGraphUSS"));
            GridBackground grid = new GridBackground();

            Insert(0, grid);
            grid.StretchToParentSize();

            AddSearchWindow();

            AddNodeView(new Vector2(100, 100), typeof(RootTask));

            this.StretchToParentSize();
            graphViewChanged += (e) => { editor.IsUnsaved = true; return(e); };
        }
Exemple #2
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();
        }