Is there a way to set "save game object children" for a separate game object?
I know there is a global setting in the settings menu and there is an ES3 Game Object to decide which component to save.
But these two settings can not be set for a separate game object.
In my project characters have only a part that needs to save the children and have a big tree (i.e. bones ) that does not need to be saved.
The closet one is a global setting for excluding objects but it is wire to add all characters in it.
It would be best if there is a "save child flag" in the ES3 Game Object. When set it true the game object child is excluded from save.
Thanks in advance.
Is there a way to set "save game object children" for a separate game object?
Re: Is there a way to set "save game object children" for a separate game object?
Hi there,
You can do this by providing an ES3Settings object as a parameter to your ES3.Save call with the saveChildren flag set to true or false. I.e.
All the best,
Joel
You can do this by providing an ES3Settings object as a parameter to your ES3.Save call with the saveChildren flag set to true or false. I.e.
Code: Select all
var settings = new ES3Settings();
settings.saveChildren = false;
ES3.Save("key", value, settings);
Joel
Re: Is there a way to set "save game object children" for a separate game object?
Great, thank you.
Can I overwrite the default settings and set them back?
like this:
ES3Settings t = ES3Settings.defaultSettings;
t.saveChildren = false;
ES3.Save(go.name, go, _sceneName, t);
t.saveChildren = true;
Can I overwrite the default settings and set them back?
like this:
ES3Settings t = ES3Settings.defaultSettings;
t.saveChildren = false;
ES3.Save(go.name, go, _sceneName, t);
t.saveChildren = true;
Re: Is there a way to set "save game object children" for a separate game object?
Yes, this is a valid way of doing it. You could actually simplify your code to this:
ES3Settings.defaultSettings.saveChildren = false;
ES3.Save(go.name, go, _sceneName);
ES3Settings.defaultSettings.saveChildren = true;
All the best,
Joel
ES3Settings.defaultSettings.saveChildren = false;
ES3.Save(go.name, go, _sceneName);
ES3Settings.defaultSettings.saveChildren = true;
All the best,
Joel