From 8a7007312ca9ef4ba0249be718f503e5c1b6fe9e Mon Sep 17 00:00:00 2001 From: Jason Ma <1312119064@qq.com> Date: Mon, 30 Oct 2023 22:21:11 +0800 Subject: [PATCH] fix gui style warnings --- Editor/Helper.cs | 7 ++----- package.json | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Editor/Helper.cs b/Editor/Helper.cs index 04d8340..63ba1d9 100644 --- a/Editor/Helper.cs +++ b/Editor/Helper.cs @@ -173,7 +173,7 @@ public static float PowPreserveSign(float f, float p) #region GUI Styles - public static readonly GUIStyle guiStyles_IconButton = new GUIStyle("IconButton") { fixedHeight = 0, fixedWidth = 0}; + public static readonly GUIStyle guiStyles_IconButton = new GUIStyle(EditorStyles.iconButton) { fixedHeight = 0, fixedWidth = 0}; #endregion @@ -217,8 +217,6 @@ public static Rect[] SplitRect(Rect rectToSplit, int n) #endif }; - private static GUIStyle _guiStyle_Toggle = new GUIStyle("Toggle"); - private static GUIStyle _guiStyle_ToggleMixed = new GUIStyle("ToggleMixed"); public static bool DrawFoldout(Rect rect, ref bool isFolding, bool toggleValue, bool hasToggle, GUIContent label) { var toggleRect = new Rect(rect.x + 8f, rect.y + 7f, 13f, 13f); @@ -256,8 +254,7 @@ public static bool DrawFoldout(Rect rect, ref bool isFolding, bool toggleValue, // Toggle Icon if (hasToggle) { - GUI.Toggle(toggleRect, EditorGUI.showMixedValue ? false : toggleValue, String.Empty, - EditorGUI.showMixedValue ? _guiStyle_ToggleMixed : _guiStyle_Toggle); + EditorGUI.Toggle(toggleRect, string.Empty, toggleValue); } return toggleValue; diff --git a/package.json b/package.json index d4a5663..74b2068 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.jasonma.lwgui", - "version": "1.13.2", + "version": "1.13.3", "displayName": "LWGUI", "description": "A Lightweight, Flexible, Powerful Shader GUI System for Unity.", "keywords": [