Opposite of Awake()

Is there a function that is like Awake() but happens when the script ends?

I need it so that if the player exits out of the game without using the exit button a line of code will be ran.

OnDestroy happens when an object is destroyed:

OnApplicationQuit happens when the app quits:

1 Like

OnDisable()

1 Like

This answer is not only wrong, it is also twelve years late. Please do not clutter the forum with useless contributions.

5 Likes