EnableVertexSnapping() 개인적인 정적인 메소드

private static EnableVertexSnapping ( int id ) : void
id int
리턴 void
예제 #1
0
        public static void HandleKeyAndMouseMove(int id)
        {
            Event current = Event.current;

            switch (current.GetTypeForControl(id))
            {
            case EventType.MouseMove:
                if (!Tools.vertexDragging)
                {
                    break;
                }
                VertexSnapping.EnableVertexSnapping(id);
                current.Use();
                break;

            case EventType.KeyDown:
                if (current.keyCode != KeyCode.V)
                {
                    break;
                }
                if (!Tools.vertexDragging && !current.shift)
                {
                    VertexSnapping.EnableVertexSnapping(id);
                }
                current.Use();
                break;

            case EventType.KeyUp:
                if (current.keyCode != KeyCode.V)
                {
                    break;
                }
                if (current.shift)
                {
                    Tools.vertexDragging = !Tools.vertexDragging;
                }
                else if (Tools.vertexDragging)
                {
                    Tools.vertexDragging = false;
                }
                if (Tools.vertexDragging)
                {
                    VertexSnapping.EnableVertexSnapping(id);
                }
                else
                {
                    VertexSnapping.DisableVertexSnapping(id);
                }
                current.Use();
                break;
            }
        }
예제 #2
0
        public static void HandleKeyAndMouseMove(int id)
        {
            Event     current        = Event.current;
            EventType typeForControl = current.GetTypeForControl(id);

            if (typeForControl != EventType.MouseMove)
            {
                if (typeForControl != EventType.KeyDown)
                {
                    if (typeForControl == EventType.KeyUp)
                    {
                        if (current.keyCode == KeyCode.V)
                        {
                            if (current.shift)
                            {
                                Tools.vertexDragging = !Tools.vertexDragging;
                            }
                            else if (Tools.vertexDragging)
                            {
                                Tools.vertexDragging = false;
                            }
                            if (Tools.vertexDragging)
                            {
                                VertexSnapping.EnableVertexSnapping(id);
                            }
                            else
                            {
                                VertexSnapping.DisableVertexSnapping(id);
                            }
                            current.Use();
                        }
                    }
                }
                else if (current.keyCode == KeyCode.V)
                {
                    if (!Tools.vertexDragging && !current.shift)
                    {
                        VertexSnapping.EnableVertexSnapping(id);
                    }
                    current.Use();
                }
            }
            else if (Tools.vertexDragging)
            {
                VertexSnapping.EnableVertexSnapping(id);
                current.Use();
            }
        }