Skip to content

Instantly share code, notes, and snippets.

@MartinGonzalez
Created January 21, 2019 00:32
Show Gist options
  • Save MartinGonzalez/dfc589d3404a48a23ecf6cbb390bc452 to your computer and use it in GitHub Desktop.
Save MartinGonzalez/dfc589d3404a48a23ecf6cbb390bc452 to your computer and use it in GitHub Desktop.
ExampleEditorWindowV2.cs
void OnGUI() {
// Everything inside BeginHorizontal and EndHorizontal will be distributed horizontally
GUILayout.BeginHorizontal();
GUILayout.Label("Hello");
GUILayout.TextField("World!");
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
GUILayout.BeginVertical();
GUILayout.Label("Bool Value");
_toggle = GUILayout.Toggle(_toggle, "");
GUILayout.EndVertical();
GUILayout.BeginVertical();
GUILayout.Label("String Value");
_string = GUILayout.TextField(_string);
GUILayout.EndVertical();
GUILayout.EndHorizontal();
GUILayout.Label("Another label here");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment