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.
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:
OnDisable()
This answer is not only wrong, it is also twelve years late. Please do not clutter the forum with useless contributions.