Hello Is it possible to load a value after using autosave? In the documentation in Autosave it doesn't mention it.
I can use save with code in addition to auto save , on 2 locationbut it's not great.
What I would like to do is simply retrieve a value saved during the game so that in the main menu scene in order to unlock chapters.
AutoSave load chosen value
Re: AutoSave load chosen value
Hi there,
I'm not fully sure I understand what you mean. However, I will assume that you mean loading a specific variable.
Auto Save is for saving GameObjects and their supported Components and loading them in the same scene they were saved. If you want to save specific values and load them in a different scene then you would need to do this with code as you've suggested.
All the best,
Joel
I'm not fully sure I understand what you mean. However, I will assume that you mean loading a specific variable.
Auto Save is for saving GameObjects and their supported Components and loading them in the same scene they were saved. If you want to save specific values and load them in a different scene then you would need to do this with code as you've suggested.
All the best,
Joel
Re: AutoSave load chosen value
So thank you if our game has several scenes, we need several save locations to know which scene to launch from the main menu of the game if we use Auto Save. 1 location for the auto save and 1 other location for the save by code in which there is the scene that needs to be loaded.
If the game has a single scene ES3.FileExists(saveFileName) will be enough.
If the game has a single scene ES3.FileExists(saveFileName) will be enough.
Re: AutoSave load chosen value
Hi there,
You can save your ES3.Save data in the same file as your Auto Save data if you prefer. You just need to ensure that you've set the Location to Cache in Tools > Easy Save 3 > Settings (as Auto Save stores to the Cache by default).
Then to save using code you would simply do ...
... without specifying a filename. This stores the data to the default file (the same place that Auto Save stores its data).
And then to load it:
Also note that data saved using ES3.Save isn't scene specific, so you can load it from any scene.
All the best,
Joel
You can save your ES3.Save data in the same file as your Auto Save data if you prefer. You just need to ensure that you've set the Location to Cache in Tools > Easy Save 3 > Settings (as Auto Save stores to the Cache by default).
Then to save using code you would simply do ...
Code: Select all
ES3.Save("sceneName", SceneManager.GetActiveScene().name);
And then to load it:
Code: Select all
if(ES3.FileExists())
SceneManager.LoadScene( ES3.Load<string>("sceneName") );
All the best,
Joel
Re: AutoSave load chosen value
it's great thank you for these clarifications.