public override void Enter() { backupWasRestored.Value = ES3.RestoreBackup(filePath.Value, GetSettings()); }
private void OnApplicationQuit() { float PreviousSecondsPlayed = ES3.Load("SecondsPlayed", "TimePlayed.txt", 0f); ES3.Save <float>("SecondsPlayed", PreviousSecondsPlayed + Time.unscaledTime, "TimePlayed.txt"); }
public void Load(int fileIndex) { flags = ES3.Load(saveString, new GameFlags()); }
private void SaveMaterials() { ES3.Save <STMaterial>("PlayerMaterials", this.playerMaterial, "PlayerMaterials.es3"); }
public void AddShield(int num = 2) { shield += num; heartUI.AddShield(num); ES3.Save <int>("Shield", shield, "Player.es3"); }
public static float GetFloat(string key, float defaultFloat) { return(ES3.Load(key, defaultFloat)); }
public static string GetString(string key, string defaultValue) { return(ES3.Load(key, defaultValue)); }
/// <summary>Loads the default file as a byte array.</summary> /// <param name="settings">The settings we want to use to override the default settings.</param> public static string LoadRawString(ES3Settings settings) { var bytes = ES3.LoadRawBytes(settings); return(settings.encoding.GetString(bytes, 0, bytes.Length)); }
/// <summary>Loads a PNG or JPG as a Texture2D.</summary> /// <param name="settings">The settings we want to use to override the default settings.</param> public static Texture2D LoadImage(ES3Settings settings) { byte[] bytes = ES3.LoadRawBytes(settings); return(LoadImage(bytes)); }
public override void Enter() { keyCount.Value = ES3.GetKeys(filePath.Value, GetSettings()).Length; }
public override void Enter() { directories.Values = ES3.GetDirectories(directoryPath.Value, GetSettings()); directories.SaveChanges(); }
public override void Enter() { keys.Values = ES3.GetKeys(filePath.Value, GetSettings()); keys.SaveChanges(); }
public override void Enter() { ES3.CopyDirectory(oldDirectoryPath.Value, newDirectoryPath.Value, GetSettings(), GetSettings()); }
public override void Enter() { ES3.CopyFile(oldFilePath.Value, newFilePath.Value, GetSettings(), GetSettings()); }
public static int GetInt(string key, int defalutValue) { return(ES3.Load(key, defalutValue)); }
/// <summary>Creates a backup of a file.</summary> /// <remarks>A backup is created by copying the file and giving it a .bak extension. /// If a backup already exists it will be overwritten, so you will need to ensure that the old backup will not be required before calling this method.</remarks> /// <param name="settings">The settings we want to use to override the default settings.</param> public static void CreateBackup(ES3Settings settings) { var backupSettings = new ES3Settings(settings.path + backupFileSuffix, settings); ES3.CopyFile(backupSettings, settings); }
public static void SetInt(string key, int usefulValue) { ES3.Save <int>(key, usefulValue); }
/// <summary>Uploads a local file to the server, overwriting any existing file.</summary> /// <param name="es3File">An ES3File containing the data we want to upload.</param> /// <param name="user">The unique name of the user this file belongs to, if the file isn't globally accessible.</param> /// <param name="password">The password of the user this file belongs to.</param> public IEnumerator UploadFile(ES3Settings settings, string user, string password) { return(UploadFile(ES3.LoadRawBytes(settings), settings, user, password)); }
public static void SetFloat(string key, float usefulValue) { ES3.Save <float>(key, usefulValue); }
private long GetFileTimestamp(ES3Settings settings) { return(DateTimeToUnixTimestamp(ES3.GetTimestamp(settings))); }
public static void SetString(string key, string usefulValue) { ES3.Save <string>(key, usefulValue); }
public void ClearData() { Debug.Log("Cleared SaveData"); ES3.DeleteFile("SaveData"); }
public override void RestoreHealth(float NewHealth = 1f) { heartUI.AddHeart(((int)fCurrentHealth + (int)NewHealth) <= (int)fMaxHealth ? (int)NewHealth : (int)(fMaxHealth - fCurrentHealth)); base.RestoreHealth(NewHealth); ES3.Save <float>("CurrentHealth", fCurrentHealth, "Player.es3"); }
public AudioClip LoadAudio(string _key) { return(ES3.LoadAudio($"{Application.persistentDataPath}/{_key}.wav", AudioType.WAV)); }
public void AddMaxHealth(int num = 2) { fMaxHealth += num; heartUI.SetHeart((int)fCurrentHealth, (int)fMaxHealth, shield); ES3.Save <float>("MaxHealth", fMaxHealth, "Player.es3"); }
private void DeleteData() { Debug.Log("clear data"); ES3.DeleteFile(); PlayerPrefs.DeleteAll(); }
public void Save(int fileIndex) { ES3.Save <GameFlags>(saveString, flags); }
public void SaveTest() { ES3.Save <int>("SLInt", SLInt); }
public void AddCash(int cashToAdd) { TotalCash.ApplyChange(cashToAdd); ES3.Save <int>(SaveKeys.TotalCash, TotalCash.Value); }
public override void Enter() { ES3.CreateBackup(filePath.Value, GetSettings()); }