LoadInto single GameObjects from array?
Posted: Sat May 30, 2020 11:02 am
Hi,
I have been trying to figure out whether I can use ES3.LoadInto to reference single GameObjects inside a saved GameObject array to their existing counterparts in the scene?
Basically I was trying to go with the usual persistent gameobject saving and loading approach and every time I kind of got lost along the way and thought of a simpler solution.
So I am currently running this:
And now the question is if I can use something like:
...you get the idea. I can't use LoadInto on the array properly and I also can't use LoadInto with data that's already loaded, can I?
I'm pretty sure I got confused along the way and there is a much better solution than what I did but right now my brain won't cooperate.
I have been trying to figure out whether I can use ES3.LoadInto to reference single GameObjects inside a saved GameObject array to their existing counterparts in the scene?
Basically I was trying to go with the usual persistent gameobject saving and loading approach and every time I kind of got lost along the way and thought of a simpler solution.
So I am currently running this:
Code: Select all
ES3.Save("events", GameObject.FindGameObjectsWithTag("Event"), mapFileName);
Code: Select all
GameObject[] eventarray;
eventarray = ES3.Load<GameObject[]>("events", mapFileName);
foreach(GameObject obj in eventarray)
{
//doesnt work obviously because I cant grab a single object from an array while loading
ES3.LoadInto<GameObject>("events", mapFileName, GameObject.Find(obj.name));
}
I'm pretty sure I got confused along the way and there is a much better solution than what I did but right now my brain won't cooperate.