Custom ES3Type Troubles

Discussion and help for Easy Save 3
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Custom ES3Type Troubles

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply