Save and load conditions
Save and load conditions
Hello, I configured Easy save3 on my project a little while ago, the plugin is perfect for what I want to achieve but I have a problem with my automatic save, I would like to use a condition between two scenes to know if my save file is created or not in order to give game logic "new game, game loader" ect .. I have used script api, but it doesn't seem to work.
Re: Save and load conditions
Hi there,
You should be able to use ES3.FileExists(yourFileName) to check whether the file exists. would you be able to show me the code you're using?
All the best,
Joel
You should be able to use ES3.FileExists(yourFileName) to check whether the file exists. would you be able to show me the code you're using?
All the best,
Joel
Re: Save and load conditions
Code: Select all
public class MainMenu : MonoBehaviour
{
private bool quality = false;
void Start()
{
}
public void ChargerPartie ()
{
if (ES3.FileExists ("SaveFile0.es3")) {
Application.LoadLevel ("Projet A");
}
}
public void NouvellePartie ()
{
ES3.DeleteDirectory ("SaveFile0.es3");
Application.LoadLevel ("Projet A");
Code: Select all
private MainMenu main;
void Start () {
if (ES3.FileExists ("SaveFile0.es3")) {
ES3AutoSaveMgr.Current.Load ();
}
}
// Update is called once per frame
void Update () {
}
public void save()
{
ES3AutoSaveMgr.Current.Save();
// Create an ES3File.
//var es3File = new ES3File("myFile.es3");
}
public void load()
{
if(ES3.FileExists("SaveFile0.es3")) {
ES3AutoSaveMgr.Current.Load ();
}
}
}
Re: Save and load conditions
Hi there,
Just to check, is the filename set to SaveFile0.es3 in Window > Easy Save 3 > Auto Save > Advanced Settings?
Also you appear to be using ES3.DeleteDirectory to delete your save file, when you should be using ES3.DeleteFile.
All the best,
Joel
Just to check, is the filename set to SaveFile0.es3 in Window > Easy Save 3 > Auto Save > Advanced Settings?
Also you appear to be using ES3.DeleteDirectory to delete your save file, when you should be using ES3.DeleteFile.
All the best,
Joel
Re: Save and load conditions
Great ! I come realised my error, sorry for the disturbance. The system function at the perfection, one thousand thank again !