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() { 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. "); }