Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity gui style color button

#if UNITY_EDITOR
	[CustomEditor(typeof(MyClass))]
	public class MyClassEditor : Editor
	{
		public override void OnInspectorGUI()
		{
			DrawDefaultInspector();

			var style = new GUIStyle(GUI.skin.button);

			style.normal.textColor = Color.red;

			MyClass c = (MyClass)target;

			if (GUILayout.Button("Button Name", style))
			{
				c.MyMethod();
			}
		}
	}
#endif
Source by www.reddit.com #
 
PREVIOUS NEXT
Tagged: #unity #gui #style #color #button
ADD COMMENT
Topic
Name
4+2 =