/// <summary> /// Wipes <see cref="Instance" /> and deletes any existing save data within <see cref="PlayerPrefs" />. /// </summary> public static void Reset() { Instance = new PlayerData(); PlayerPrefs.DeleteKey( typeof( PlayerData ).Name ); }
/// <summary> /// Assigns any save data within <see cref="PlayerPrefs" /> to <see cref="Instance" />. /// </summary> /// <param name="defaultData"> /// Default data to load if no save exists. /// </param> public static void Load( PlayerData defaultData = null ) { Instance = PlayerPrefsHelper.TryLoad( typeof( PlayerData ).Name, defaultData ?? new PlayerData() ); }