Saving object with many children/grandchildren.
Posted: Mon Jun 26, 2023 7:31 pm
Hello, I am trying to use Easy Save 3 for my Unity project, which aims to save an object along with all its children, grandchildren, etc. I noticed that when about 12 prefabs are connected together like a staircase (picture below), it seems like the saving process breaks down, and only when it's less than this number does it start working as it should. I am using in by saving it as bytes sending it to database and then load it later in WebGL. The entire hierarchy consists of prefabs that are spawned several times from the Resources folder. Hence, I would like to ask if there's a possibility to save the entire object hierarchy without serializing too much data. If it is possible to spawn specific prefab and adjust, its local rotation, the material of its child, and whether it is active. Sorry if the question is wierd but I tried to look for guides in the documetation and youtube and I am still confused. Thank you for any help.
Code for saving the object:
Code for saving the object:
Code: Select all
public string SaveToBase64()
{
string filePath = "temp.es3";
ES3.Save<GameObject>("myGameObject", mainPrefab, filePath);
byte[] bytes = ES3.LoadRawBytes(filePath);
string base64 = Convert.ToBase64String(bytes);
return base64;
}