public static void HandleDrawing(CurcuitEditor curcuitEditor)
        {
            CurcuitEditorDrawer.curcuitEditor = curcuitEditor;

            if (curcuitEditor == null)
            {
                return;
            }

            foreach (Path path in curcuitEditor.TargetCurcuit)
            {
                if (path == curcuitEditor.SelectedPath)
                {
                    currentColorOpacity = CurcuitEditor.selectedPathOpacity;

                    DrawSelectedPathMoveHandle();
                }
                else
                {
                    currentColorOpacity = CurcuitEditor.nonSelectedPathOpacity;
                }

                int pathCount = path.Count;

                Handles.color =
                    new Color(
                        curcuitEditor.NormalColor.r,
                        curcuitEditor.NormalColor.g,
                        curcuitEditor.NormalColor.b,
                        currentColorOpacity
                        );

                if (pathCount > 0)
                {
                    ShowBezierPoint(path[0]);
                }

                if (path.IsCyclic && pathCount >= 2)
                {
                    ShowBezierCurve(path[pathCount - 1], path[0], pathCount - 1, 0, path);
                }

                for (var i = 1; i < pathCount; i++)
                {
                    ShowBezierPoint(path[i]);

                    ShowBezierCurve(path[i - 1], path[i], i - 1, i, path);
                }
            }
        }
Пример #2
0
        public static void HandleInput(CurcuitEditor curcuitEditor)
        {
            CurcuitEditerInputHandler.curcuitEditor = curcuitEditor;

            if (curcuitEditor == null)
            {
                return;
            }

            Event guiEvent = Event.current;

            Vector2 mousePosition = HandleUtility.GUIPointToWorldRay(guiEvent.mousePosition).origin;

            HandlePathMoveHandleActivation(guiEvent);
            HandleAdd(guiEvent, mousePosition);
            HandleSelection(guiEvent, mousePosition); // TODO
            HandleRemove(guiEvent);
            HandleInsertPoint(guiEvent);              // TODO
        }
Пример #3
0
 public static void DrawInspector(CurcuitEditor curcuitEditor)
 {
     CurcuitEditorInspectorDrawer.curcuitEditor = curcuitEditor;
     DrawInspectorUI();
 }