예제 #1
0
파일: View.cs 프로젝트: mbbarange/hivemind
        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;
        }
예제 #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);
        }