private void OnGUI() { GUILayout.Label("Create new tile", EditorStyles.boldLabel); editor.OnInspectorGUI(); isValid = editor.IsValid(); if (isValid) { if (GUILayout.Button("Create New Tile")) { if (Create()) // true if sucessful { Close(); } } } if (GUILayout.Button("Cancel")) { Close(); } }