Sent to all game objects before the application is quit.
function OnApplicationQuit() {
// Make sure prefs are saved before quitting.
PlayerPrefs.Save();
}
using UnityEngine; using System.Collections; public class Example : MonoBehaviour { void OnApplicationQuit() { PlayerPrefs.Save(); } }
import UnityEngine import System.Collections public class Example(MonoBehaviour): def OnApplicationQuit() as void: PlayerPrefs.Save()