@@ -32,6 +32,11 @@ public static class PawlygonEditorUI
3232 private static GUIStyle headerSubtitleStyle ;
3333 private static GUIStyle footerStyle ;
3434 private static GUIStyle footerLinkStyle ;
35+ private static GUIStyle headerBoxStyle ;
36+ private static GUIStyle footerBoxStyle ;
37+ private static GUIStyle primaryButtonStyle ;
38+ private static GUIStyle sectionBoxStyle ;
39+ private static GUIStyle sectionTitleStyle ;
3540
3641 // =====================================================================
3742 // Style Initialization
@@ -106,6 +111,26 @@ public static void EnsureStyles()
106111
107112 footerLinkStyle . normal . textColor = new Color ( 0.39f , 0.67f , 1f ) ;
108113 footerLinkStyle . hover . textColor = new Color ( 0.58f , 0.79f , 1f ) ;
114+
115+ headerBoxStyle = new GUIStyle ( EditorStyles . helpBox )
116+ {
117+ padding = new RectOffset ( 14 , 14 , 12 , 12 )
118+ } ;
119+
120+ footerBoxStyle = new GUIStyle ( EditorStyles . helpBox )
121+ {
122+ padding = new RectOffset ( 12 , 12 , 10 , 10 )
123+ } ;
124+
125+ sectionBoxStyle = new GUIStyle ( EditorStyles . helpBox )
126+ {
127+ padding = new RectOffset ( 15 , 15 , 15 , 15 )
128+ } ;
129+
130+ sectionTitleStyle = new GUIStyle ( EditorStyles . boldLabel )
131+ {
132+ fontSize = 14
133+ } ;
109134 }
110135
111136 // =====================================================================
@@ -126,7 +151,7 @@ public static void DrawHeader(string title, string subtitle)
126151
127152 EditorGUILayout . Space ( 6f ) ;
128153
129- using ( new EditorGUILayout . VerticalScope ( new GUIStyle ( EditorStyles . helpBox ) { padding = new RectOffset ( 14 , 14 , 12 , 12 ) } ) )
154+ using ( new EditorGUILayout . VerticalScope ( headerBoxStyle ) )
130155 {
131156 Rect headerRect = EditorGUILayout . GetControlRect ( false , 84f ) ;
132157
@@ -162,7 +187,7 @@ public static void DrawFooter()
162187 {
163188 string version = GetPackageVersion ( ) ;
164189
165- using ( new EditorGUILayout . VerticalScope ( new GUIStyle ( EditorStyles . helpBox ) { padding = new RectOffset ( 12 , 12 , 10 , 10 ) } ) )
190+ using ( new EditorGUILayout . VerticalScope ( footerBoxStyle ) )
166191 {
167192 EditorGUILayout . LabelField ( $ "Made with \u2764 by Pawlygon Studio \u2022 v{ version } ", footerStyle ) ;
168193 EditorGUILayout . Space ( 6f ) ;
@@ -200,13 +225,16 @@ private static void DrawFooterLink(string label, string url)
200225 /// <returns>True if the button was clicked.</returns>
201226 public static bool DrawPrimaryButton ( string text , float height = 34f )
202227 {
228+ if ( primaryButtonStyle == null )
229+ {
230+ primaryButtonStyle = new GUIStyle ( GUI . skin . button ) { fontStyle = FontStyle . Bold , fontSize = 13 } ;
231+ }
232+
203233 Color oldColor = GUI . backgroundColor ;
204234 GUI . backgroundColor = EditorGUIUtility . isProSkin
205235 ? new Color ( 0.2f , 0.6f , 1f )
206236 : new Color ( 0.1f , 0.4f , 0.8f ) ;
207- bool clicked = GUILayout . Button ( text ,
208- new GUIStyle ( GUI . skin . button ) { fontStyle = FontStyle . Bold , fontSize = 13 } ,
209- GUILayout . Height ( height ) ) ;
237+ bool clicked = GUILayout . Button ( text , primaryButtonStyle , GUILayout . Height ( height ) ) ;
210238 GUI . backgroundColor = oldColor ;
211239 return clicked ;
212240 }
@@ -226,9 +254,9 @@ public static void DrawSeparator()
226254 /// </summary>
227255 public static void DrawSection ( string title , string description , Action drawContent )
228256 {
229- using ( new EditorGUILayout . VerticalScope ( new GUIStyle ( EditorStyles . helpBox ) { padding = new RectOffset ( 15 , 15 , 15 , 15 ) } ) )
257+ using ( new EditorGUILayout . VerticalScope ( sectionBoxStyle ) )
230258 {
231- EditorGUILayout . LabelField ( title , new GUIStyle ( EditorStyles . boldLabel ) { fontSize = 14 } ) ;
259+ EditorGUILayout . LabelField ( title , sectionTitleStyle ) ;
232260 EditorGUILayout . Space ( 2 ) ;
233261 EditorGUILayout . LabelField ( description , SubLabelStyle ) ;
234262 EditorGUILayout . Space ( 12 ) ;
0 commit comments