private void OnDestroy() { if (AuthorSettings.IsChanged() && !string.IsNullOrWhiteSpace(AuthorSettings.Name)) { if (EditorUtility.DisplayDialog("Default Author Info", $"Save default author info changes?", "Yes", "No")) { AuthorSettings.SaveAll(); } } }
private void DrawSaveButton() { bool enabled = AuthorSettings.IsChanged() && !string.IsNullOrWhiteSpace(AuthorSettings.Name); EditorGUI.BeginDisabledGroup(!enabled); if (GUILayout.Button("Save")) { AuthorSettings.SaveAll(); AuthorSettings.Initialize(); Debug.Log("Default author info have been updated."); } EditorGUI.EndDisabledGroup(); }