Search Unity

Prevent editor window from being closed

Discussion in 'Immediate Mode GUI (IMGUI)' started by komilll, Jun 11, 2017.

  1. komilll

    komilll

    Joined:
    May 4, 2016
    Posts:
    7
    Hello,

    I'm making simple dialogue editor to existing dialogue system. It's being saved to .txt file when closed at chosen by player folder, if not chosen, then no changes are saved. I want to make it that when user closes the editor window he gets prompt if he want to save changes ("Yes", "No", "Cancel"). If user chooses cancel then the editor window doesn't change and can be edited further. I have no idea how to prevent it instantly closed on pressing x button on editor window.

    Thanks in advance.