private void DrawAuthorSettings() { EditorGUILayout.BeginVertical(EditorStyles.helpBox); GUILayout.Label("Author:", EditorStyles.miniBoldLabel); _authorName = EditorGUILayout.TextField("Name", _authorName); _authorEmail = EditorGUILayout.TextField("E-Mail", _authorEmail); _authorUrl = EditorGUILayout.TextField("URL", _authorUrl); GUILayout.BeginHorizontal(); if (GUILayout.Button("Reset to default author settings")) { AuthorSettings.Initialize(); if (string.IsNullOrWhiteSpace(AuthorSettings.Name)) { AuthorSettingsWindow.Init(); } else { _authorName = AuthorSettings.Name; _authorEmail = AuthorSettings.Email; _authorUrl = AuthorSettings.Url; } } GUILayout.EndHorizontal(); DrawAuthorCanNotBeEmptyHelpBox(); EditorGUILayout.EndVertical(); }
public static void Init() { _window = GetWindow <AuthorSettingsWindow>(false, "Default Author Info", true); _window.minSize = WindowSize; _window.maxSize = WindowSize; _window.Show(); AuthorSettings.Initialize(); }