Hello,
i tried the auto save feature and it work fine saving position or variables in a script component !
but when i destroy a gameobject it will be spawned and loaded on the next start ! did i miss something ?
Auto save bug or i miss something ?
Re: Auto save bug or i miss something ?
Hi there,
As mentioned in the documentation, Auto Save saves the Components of an object. It does not save whether it has been destroyed as this is not represented by the Components.
To persist a destroyed object, you could attach a script such as this to it:
Joel
As mentioned in the documentation, Auto Save saves the Components of an object. It does not save whether it has been destroyed as this is not represented by the Components.
To persist a destroyed object, you could attach a script such as this to it:
using UnityEngine; public class SaveDestroyed : MonoBehaviour { public string guid = System.Guid.NewGuid().ToString(); void Start () { if(ES3.KeyExists(guid)) Destroy(this.gameObject); } public void Destroy() { ES3.Save<bool>(guid, true); Destroy(this.gameObject); } }All the best,
Joel
-
- Posts: 2
- Joined: Sun Jan 13, 2019 2:30 pm
Re: Auto save bug or i miss something ?
Thanks you for the answer and the code example