GUIStyle style = new GUIStyle(); style.normal.background = MakeTex(2, 2, Color.red); GUI.Label(new Rect(10, 10, 100, 20), "Rectangle", style);
GUIStyle style = new GUIStyle(); style.normal.background = (Texture2D)Resources.Load("button_texture"); GUI.Button(new Rect(10, 10, 100, 20), "Button", style);This example is also using Unity's built-in library for the GUIStyle method, as well as the Resources class for loading a texture. In conclusion, the GUIStyle Draw method is a powerful tool for customizing the appearance of the user interface in Unity. It is part of the Unity's built-in GUI package.