From 21e186f75b504d832d9c7bef0456edd7d5d3155e Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 8 Sep 2021 10:52:35 +0800 Subject: +behavior design --- .../Utils/Editor/StyledGUI/DrawInspectorBanner.cs | 64 ---------------------- 1 file changed, 64 deletions(-) delete mode 100644 Assets/BOXOPHOBIC/Utils/Editor/StyledGUI/DrawInspectorBanner.cs (limited to 'Assets/BOXOPHOBIC/Utils/Editor/StyledGUI/DrawInspectorBanner.cs') diff --git a/Assets/BOXOPHOBIC/Utils/Editor/StyledGUI/DrawInspectorBanner.cs b/Assets/BOXOPHOBIC/Utils/Editor/StyledGUI/DrawInspectorBanner.cs deleted file mode 100644 index 0d3476c5..00000000 --- a/Assets/BOXOPHOBIC/Utils/Editor/StyledGUI/DrawInspectorBanner.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Cristian Pop - https://boxophobic.com/ - -using UnityEngine; -using UnityEditor; -using Boxophobic.Constants; - -namespace Boxophobic.StyledGUI -{ - public partial class StyledGUI - { - public static void DrawInspectorBanner(Color bannerColor, string bannerText, string helpURL) - { - GUILayout.Space(20); - - var bannerFullRect = GUILayoutUtility.GetRect(0, 0, 40, 0); - var bannerBeginRect = new Rect(bannerFullRect.position.x, bannerFullRect.position.y, 20, 40); - var bannerMiddleRect = new Rect(bannerFullRect.position.x + 20, bannerFullRect.position.y, bannerFullRect.xMax - 54, 40); - var bannerEndRect = new Rect(bannerFullRect.xMax - 20, bannerFullRect.position.y, 20, 40); - var iconRect = new Rect(bannerFullRect.xMax - 36, bannerFullRect.position.y + 5, 30, 30); - - Color guiColor; - - if (EditorGUIUtility.isProSkin) - { - bannerColor = new Color(bannerColor.r, bannerColor.g, bannerColor.b, 1f); - } - else - { - bannerColor = CONSTANT.ColorLightGray; - } - - if (bannerColor.r + bannerColor.g + bannerColor.b <= 1.5f) - { - guiColor = CONSTANT.ColorLightGray; - } - else - { - guiColor = CONSTANT.ColorDarkGray; - } - - GUI.color = bannerColor; - - GUI.DrawTexture(bannerBeginRect, CONSTANT.BannerImageBegin, ScaleMode.StretchToFill, true); - GUI.DrawTexture(bannerMiddleRect, CONSTANT.BannerImageMiddle, ScaleMode.StretchToFill, true); - GUI.DrawTexture(bannerEndRect, CONSTANT.BannerImageEnd, ScaleMode.StretchToFill, true); - -#if UNITY_2019_3_OR_NEWER - GUI.Label(bannerFullRect, "" + bannerText + "", CONSTANT.TitleStyle); -#else - GUI.Label(bannerFullRect, "" + bannerText + "", CONSTANT.TitleStyle); -#endif - GUI.color = guiColor; - - if (GUI.Button(iconRect, CONSTANT.IconHelp, new GUIStyle { alignment = TextAnchor.MiddleCenter })) - { - Application.OpenURL(helpURL); - } - - GUI.color = Color.white; - GUILayout.Space(10); - } - } -} - -- cgit v1.1-26-g67d0