From 22891bf59032ba88262824255a706d652031384b Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 10 Mar 2022 14:07:40 +0800 Subject: * move folder --- Assets/Tools/ActionTool/Editor/ActionEditorUI.cs | 99 ------------------------ 1 file changed, 99 deletions(-) delete mode 100644 Assets/Tools/ActionTool/Editor/ActionEditorUI.cs (limited to 'Assets/Tools/ActionTool/Editor/ActionEditorUI.cs') diff --git a/Assets/Tools/ActionTool/Editor/ActionEditorUI.cs b/Assets/Tools/ActionTool/Editor/ActionEditorUI.cs deleted file mode 100644 index a1e2ba36..00000000 --- a/Assets/Tools/ActionTool/Editor/ActionEditorUI.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; - -namespace ActionTool -{ - internal class ActionEditorUI - { - static ActionEditorUI s_instance; - - static Material m_material; - - public Material defaultUIMaterail { get { return m_material; } } - - public static ActionEditorUI Get() - { - bool flag = s_instance == null; - if (flag) - { - s_instance = new ActionEditorUI(); - } - return s_instance; - } - - private ActionEditorUI() - { - m_material = new Material(Shader.Find("Hidden/Internal-Colored")); - m_material.hideFlags = HideFlags.HideAndDontSave; - } - - public void DrawVerticalLineFast(float x, float minY, float maxY, Color color) - { - // 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) - { - //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 DrawRectFrame(Rect rect, Color col) - { - DrawHorizontalLineFast(rect.y, rect.x, rect.x + rect.width, col); - DrawHorizontalLineFast(rect.y + rect.height, rect.x, rect.x + rect.width, col); - DrawVerticalLineFast(rect.x, rect.y, rect.y + rect.height, col); - DrawVerticalLineFast(rect.x + rect.width, rect.y, rect.y + rect.height, col); - } - - public void SelectObject(Object obj) - { - Selection.activeObject = obj; - EditorGUIUtility.PingObject(obj); - } - - public void SelectObject(string path) - { - Object obj = AssetDatabase.LoadAssetAtPath(path, typeof(Object)) as Object; - if(obj) - { - SelectObject(obj); - } - } - - } -} \ No newline at end of file -- cgit v1.1-26-g67d0