Beispiel #1
0
        public bool Draw(Rect position)
        {
            bool needsRepaint = HandleMouseEvents(position, BTEditorManager.Manager.behaviorTree.nodes);

            scrollPoint = GUI.BeginScrollView(new Rect(0, 0, position.width, position.height), scrollPoint, canvas);

            if (gridRenderer == null) gridRenderer = new GridRenderer();
            gridRenderer.Draw(scrollPoint, canvas);

            DrawNodes(BTEditorManager.Manager.behaviorTree.nodes);
            if (currentMode == Mode.ConnectChild || currentMode == Mode.ConnectParent) {
                DrawConnectionLine();
                needsRepaint = true;
            }

            GUI.EndScrollView();

            return needsRepaint;
        }
Beispiel #2
0
        public bool Draw(Rect position)
        {
            bool needsRepaint = HandleMouseEvents(position, BTEditorManager.Manager.behaviorTree.nodes);

            scrollPoint = GUI.BeginScrollView(new Rect(0, 0, position.width, position.height), scrollPoint, canvas);

            if (gridRenderer == null)
            {
                gridRenderer = new GridRenderer();
            }
            gridRenderer.Draw(scrollPoint, canvas);

            DrawNodes(BTEditorManager.Manager.behaviorTree.nodes);
            if (currentMode == Mode.ConnectChild || currentMode == Mode.ConnectParent)
            {
                DrawConnectionLine();
                needsRepaint = true;
            }

            GUI.EndScrollView();

            return(needsRepaint);
        }