diff options
author | chai <chaifix@163.com> | 2021-07-07 18:47:37 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-07-07 18:47:37 +0800 |
commit | a13f10139d33264fc9ebc5a15c75faf16fc7757e (patch) | |
tree | 9d6c40a21fc873c6e25ff4bbdeba663a73927427 /Assets/ActionTool/Editor/ActionEditorUI.cs | |
parent | 1bb4971cffac3851a119f16e815bfe42abfc2df6 (diff) |
+Action Tool
Diffstat (limited to 'Assets/ActionTool/Editor/ActionEditorUI.cs')
-rw-r--r-- | Assets/ActionTool/Editor/ActionEditorUI.cs | 65 |
1 files changed, 65 insertions, 0 deletions
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 |