Skip to content

Instantly share code, notes, and snippets.

@BennettWerner
Forked from thebeardphantom/EditorHelper.cs
Created May 3, 2021 16:44
Show Gist options
  • Select an option

  • Save BennettWerner/dffc84e4d3e31cb9b5645e1397238e5c to your computer and use it in GitHub Desktop.

Select an option

Save BennettWerner/dffc84e4d3e31cb9b5645e1397238e5c to your computer and use it in GitHub Desktop.

Revisions

  1. Michael Notarnicola created this gist Jul 29, 2019.
    23 changes: 23 additions & 0 deletions EditorHelper.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    using UnityEditor;

    [InitializeOnLoad]
    public static class EditorHelper
    {
    #region Constructors

    static EditorHelper()
    {
    EditorApplication.wantsToQuit += OnEditorWantsToQuit;
    }

    #endregion

    #region Methods

    private static bool OnEditorWantsToQuit()
    {
    return EditorUtility.DisplayDialog("Confirm Quit", "Are you sure you want to quit?", "Yes", "No");
    }

    #endregion
    }