From faae081b30991e71f267a8ac58e0fba69c828449 Mon Sep 17 00:00:00 2001 From: ALittlePatate Date: Tue, 7 Mar 2023 12:18:28 +0100 Subject: [PATCH] fixed color picker overriding GUI.skin.box.normal.background --- DevourClient/Helpers/GUIHelper.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DevourClient/Helpers/GUIHelper.cs b/DevourClient/Helpers/GUIHelper.cs index a192108..ff2f1d8 100644 --- a/DevourClient/Helpers/GUIHelper.cs +++ b/DevourClient/Helpers/GUIHelper.cs @@ -21,15 +21,15 @@ namespace DevourClient.Helpers GUI.Label(new Rect(Settings.Settings.x + 300, Settings.Settings.y + 190, 30, 30), "B"); color = new Color(R, G, B, 1); - GUI.color = color; void DrawPreview(Rect position, Color color_to_draw) { Texture2D texture = new Texture2D(1, 1); - texture.SetPixel(0, 0, color); + texture.SetPixel(0, 0, color_to_draw); texture.Apply(); - GUI.skin.box.normal.background = texture; - GUI.Box(position, GUIContent.none); + GUIStyle boxStyle = new GUIStyle(GUI.skin.box); + boxStyle.normal.background = texture; + GUI.Box(position, GUIContent.none, boxStyle); } DrawPreview(new Rect(Settings.Settings.x + 195, Settings.Settings.y + 100, 20, 90), color);