First of all, I have to say that EasySave is a great tool. Really good job!
I've seen that the solution to the problem of loading the character's saved position is to assign it in Awake/Start after loading the scene.
But... what if we have, for example, 5 different saves? How to tell in a new scene from which save I want to load the position (and everything else)?
Same, what if the player starts a new game but already has a savegame for the first scene? How to avoid the error so that the new game does not start in the position from the save?
I've seen that DontDestroyOnLoad can be used and assigned to a common object with the loading script. I could add a string variable and check if string !=null in Awake. Is this how I could achieve it or is there any other, better way?
EDIT:
I found solution.
Code: Select all
public string filename;
private void Awake()
{
GameObject[] dataCatchers = GameObject.FindGameObjectsWithTag("DataCatcher");
if (dataCatchers.Length > 1)
{
Destroy(this.gameObject);
}
DontDestroyOnLoad(this.gameObject);
}
Maybe it'll help someone in the future.