From a13f10139d33264fc9ebc5a15c75faf16fc7757e Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 7 Jul 2021 18:47:37 +0800 Subject: +Action Tool --- Assets/ActionTool/Editor/ActionEditorUI.cs | 65 ++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Assets/ActionTool/Editor/ActionEditorUI.cs (limited to 'Assets/ActionTool/Editor/ActionEditorUI.cs') diff --git a/Assets/ActionTool/Editor/ActionEditorUI.cs b/Assets/ActionTool/Editor/ActionEditorUI.cs new file mode 100644 index 00000000..effa6be7 --- /dev/null +++ b/Assets/ActionTool/Editor/ActionEditorUI.cs @@ -0,0 +1,65 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace ActionTool +{ + internal class ActionEditorUI + { + private static ActionEditorUI s_instance; + + public static ActionEditorUI Get() + { + bool flag = s_instance == null; + if (flag) + { + s_instance = new ActionEditorUI(); + } + return s_instance; + } + + private ActionEditorUI() + { + } + + 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)); + } + } + + 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)); + } + } + + } +} \ No newline at end of file -- cgit v1.1-26-g67d0