Page 2 of 2

Re: Custom ES3Type Troubles

Posted: Wed Jun 20, 2018 7:11 am
by Joel
In this case you should save them using another ES2/ES3.Save call, outside of the ES3Type.

For example, let's say you're saving your TreeManager using ES2.Save<TreeManager>, then you should have another call after instead of saving the data inside the ES3Type, ES2.SaveArray<Tree>.

With regards to saving references to objects, Easy Save 3 can store references to UnityEngine.Objects (any fields in a class which are of this type will be stored by reference).

In Easy Save 2, or if your type is not of UnityEngine.Object, you will need to create your own reference list. The easiest way to do this is to put all of the object which can be referenced into a List, and then store the index of the object in this list, rather than the object itself. Then when you load, load the index, and get the item in your reference list at that index.

All the best,
Joel