コード例 #1
0
 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();
         }
     }
 }
コード例 #2
0
        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();
        }