diff options
author | chai <chaifix@163.com> | 2021-07-12 10:12:53 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-07-12 10:12:53 +0800 |
commit | 404297b51c1c71e6bb428aa199743b7fbf8db493 (patch) | |
tree | a0c3f7ba4cac452b3f97cfd740884915890324cc /Assets/ActionTool/Editor/ActionEditorUI.cs | |
parent | d373067ce7982c14040274f9eab8ad9a1c50c5f1 (diff) |
*misc
Diffstat (limited to 'Assets/ActionTool/Editor/ActionEditorUI.cs')
-rw-r--r-- | Assets/ActionTool/Editor/ActionEditorUI.cs | 71 |
1 files changed, 38 insertions, 33 deletions
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)
{
|