private void DrawSaveButton()
 {
     EditorGUI.BeginDisabledGroup(!m_ActionAssetManager.dirty);
     EditorGUILayout.Space();
     if (GUILayout.Button(s_SaveAssetGUI, EditorStyles.toolbarButton))
     {
         m_ActionAssetManager.SaveChangesToAsset();
     }
     EditorGUI.EndDisabledGroup();
 }
Ejemplo n.º 2
0
        private void DrawSaveButton()
        {
            EditorGUI.BeginDisabledGroup(!m_ActionAssetManager.dirty);
            EditorGUILayout.Space();
            if (GUILayout.Button(m_SaveAssetGUI, EditorStyles.toolbarButton))
            {
                m_ActionAssetManager.SaveChangesToAsset();
            }
            EditorGUI.EndDisabledGroup();
            GUILayout.FlexibleSpace();
            EditorGUI.BeginChangeCheck();

            m_SearchText = m_SearchField.OnToolbarGUI(m_SearchText, GUILayout.MaxWidth(250));
            if (EditorGUI.EndChangeCheck())
            {
                if (OnSearchChanged != null)
                {
                    OnSearchChanged(m_SearchText);
                }
            }
        }
Ejemplo n.º 3
0
        private void OnDestroy()
        {
            if (m_ActionAssetManager.dirty)
            {
                var result = EditorUtility.DisplayDialogComplex("Unsaved changes", "Do you want to save the changes you made before quitting?", "Save", "Cancel", "Don't Save");
                switch (result)
                {
                case 0:
                    // Save
                    m_ActionAssetManager.SaveChangesToAsset();
                    m_ActionAssetManager.CleanupAssets();
                    break;

                case 1:
                    // Cancel
                    Instantiate(this).Show();
                    break;

                case 2:
                    // Don't save
                    break;
                }
            }
        }