From 404297b51c1c71e6bb428aa199743b7fbf8db493 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 12 Jul 2021 10:12:53 +0800 Subject: *misc --- Assets/ActionTool/Editor/ActionEditorUI.cs | 71 ++++++++++++++++-------------- 1 file changed, 38 insertions(+), 33 deletions(-) (limited to 'Assets/ActionTool/Editor/ActionEditorUI.cs') diff --git a/Assets/ActionTool/Editor/ActionEditorUI.cs b/Assets/ActionTool/Editor/ActionEditorUI.cs index f04c10ea..91ff9cad 100644 --- a/Assets/ActionTool/Editor/ActionEditorUI.cs +++ b/Assets/ActionTool/Editor/ActionEditorUI.cs @@ -31,41 +31,46 @@ namespace ActionTool public void DrawVerticalLineFast(float x, float minY, float maxY, Color color) { - bool bWin = Application.platform == RuntimePlatform.WindowsEditor; - if (bWin) - { - GL.Color(color); - GL.Vertex(new Vector3(x - 0.5f, minY, 0f)); - GL.Vertex(new Vector3(x + 0.5f, minY, 0f)); - GL.Vertex(new Vector3(x + 0.5f, maxY, 0f)); - GL.Vertex(new Vector3(x - 0.5f, maxY, 0f)); - } - else - { - GL.Color(color); - GL.Vertex(new Vector3(x, minY, 0f)); - GL.Vertex(new Vector3(x, maxY, 0f)); - } - } + // GL画线在GenericMenu弹出来时会有问题 + //bool bWin = Application.platform == RuntimePlatform.WindowsEditor; + //if (bWin) + //{ + // GL.Color(color); + // GL.Vertex(new Vector3(x - 0.5f, minY, 0f)); + // GL.Vertex(new Vector3(x + 0.5f, minY, 0f)); + // GL.Vertex(new Vector3(x + 0.5f, maxY, 0f)); + // GL.Vertex(new Vector3(x - 0.5f, maxY, 0f)); + //} + //else + //{ + // GL.Color(color); + // GL.Vertex(new Vector3(x, minY, 0f)); + // GL.Vertex(new Vector3(x, maxY, 0f)); + //} + Rect rect = new Rect(x-0.5f, minY, 1, maxY - minY); + EditorGUI.DrawRect(rect, color); + } - public void DrawHorizontalLineFast(float y, float minX, float maxX, Color color) + public void DrawHorizontalLineFast(float y, float minX, float maxX, Color color) { - bool bWin = Application.platform == RuntimePlatform.WindowsEditor; - if (bWin) - { - GL.Color(color); - GL.Vertex(new Vector3(minX, y - 0.5f, 0f)); - GL.Vertex(new Vector3(minX, y + 0.5f, 0f)); - GL.Vertex(new Vector3(maxX, y + 0.5f, 0f)); - GL.Vertex(new Vector3(maxX, y - 0.5f, 0f)); - } - else - { - GL.Color(color); - GL.Vertex(new Vector3(minX, y, 0f)); - GL.Vertex(new Vector3(maxX, y, 0f)); - } - } + //bool bWin = Application.platform == RuntimePlatform.WindowsEditor; + //if (bWin) + //{ + // GL.Color(color); + // GL.Vertex(new Vector3(minX, y - 0.5f, 0f)); + // GL.Vertex(new Vector3(minX, y + 0.5f, 0f)); + // GL.Vertex(new Vector3(maxX, y + 0.5f, 0f)); + // GL.Vertex(new Vector3(maxX, y - 0.5f, 0f)); + //} + //else + //{ + // GL.Color(color); + // GL.Vertex(new Vector3(minX, y, 0f)); + // GL.Vertex(new Vector3(maxX, y, 0f)); + //} + Rect rect = new Rect(minX, y - 0.5f, maxX - minX, 1); + EditorGUI.DrawRect(rect, color); + } public void SelectObject(Object obj) { -- cgit v1.1-26-g67d0