Search Unity

Prevent Windows X button from working

Discussion in 'Scripting' started by Fuzzypup, Feb 7, 2021.

  1. Fuzzypup

    Fuzzypup

    Joined:
    Aug 13, 2013
    Posts:
    190
    Searched the forums couldn't find an answer.

    Currently I am using this which is depreciated.

    void OnApplicationQuit() {
    Application.CancelQuit();
    }

    I looked up Application.wantsToQuit and I simply don't understand how it works to prevent a the Windows X button.

    Can someone explain it in layman's terms of HOW to prevent the Windows X from working.