public int getBankCoins() { CheckFirstInit(); string encryptedBankCoins = EasySave.Load <string>("BankCoins"); return(crypto.Decrypt <int>(encryptedBankCoins)); }
private void Awake() { if (EasySave.HasKey <bool>("FirstRun")) { Lvl0Cleared = EasySave.Load <bool>("Lvl0Cleared"); Lvl1Cleared = EasySave.Load <bool>("Lvl1Cleared"); Lvl2Cleared = EasySave.Load <bool>("Lvl2Cleared"); Lvl3Cleared = EasySave.Load <bool>("Lvl3Cleared"); Lvl4Cleared = EasySave.Load <bool>("Lvl4Cleared"); Lvl5Cleared = EasySave.Load <bool>("Lvl5Cleared"); } }
void Start() { creationManager = GameObject.FindObjectOfType <CreationManager>(); selectionManager = GameObject.FindObjectOfType <SelectionManager>(); movingManager = GameObject.FindObjectOfType <MovingManager>(); if (EasySave.Load <bool>("isMapReset")) { isSaved = false; EasySave.Delete <bool>("isMapReset"); } }
// Start is called before the first frame update void Start() { LeanTween.move(RTMText, GoTo.position, 2f).setEase(Curve); StartCoroutine(moveout()); ttitty = Time.time + random(); collsizerslider = CollSizer.GetComponent <Slider>(); sizerslider = Sizer.GetComponent <Slider>(); speederslider = Speeder.GetComponent <Slider>(); frequencyslider = Frequencyx.GetComponent <Slider>(); collsize = EasySave.Load <float>("collsize", 1f); collsizerslider.value = collsize; size = EasySave.Load <float>("size", 50); sizerslider.value = size; speed = EasySave.Load <float>("speed", 50000); speederslider.value = speed; Frequency = EasySave.Load <float>("frequency", 1); frequencyslider.value = Frequency; }
// Start is called before the first frame update void Start() { string mapName = EasySave.Load <string>("ResetMapName"); if (mapName != null) { GameObject.Find("Main Menu").GetComponent <MainMenu>().CreateMap(); Spawner[] spawners = GameObject.FindObjectsOfType <Spawner>(); foreach (var spawner in spawners) { spawner.doCreateWithCustomName = true; spawner.mapName = mapName; } } EasySave.Delete <string>("ResetMapName"); Destroy(gameObject); }
private void Awake() { //Pass whatever you want to save in the function. EasySave.Save("my-int", 42); EasySave.Save("my-class", new MyClass(231, new List <int> { 23, 33 })); //Load your values with the key as a parameter and specify the type in the <>. Debug.Log("Loaded int: " + EasySave.Load <int>("my-int")); Debug.Log("Loaded MyClass: \n" + EasySave.Load <MyClass>("my-class")); //Loading with default value: defaultValue is returned if the key doesn't exist. Debug.Log("Loaded string: \"" + EasySave.Load("key", "Default Value") + "\""); //Does a key exist Debug.Log("The key \"int-key\" exists: " + EasySave.HasKey <int>("int-key")); Debug.Log("The key \"my-int\" exists: " + EasySave.HasKey <int>("my-int")); //Delete a key and it's values EasySave.Delete <int>("my-int"); Debug.Log("The key \"my-int\" has been deleted. "); }
private int getHighscore() { return(crypto.Decrypt <int>(EasySave.Load <string>("highscore"))); }