Inherited fields stored after the children fields

Discussion and help for Easy Save 3
Post Reply
Gladyon
Posts: 30
Joined: Thu Sep 07, 2017 6:51 am

Inherited fields stored after the children fields

Post by Gladyon »

I noticed that the inherited fields are stored after the children ones.
So if you have a base class with a 'Name' field, then the name will always be at the bottom of the JSON file, which isn't user-friendly.

Is it possible to store the parents fields first?
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Inherited fields stored after the children fields

Post by Joel »

Hi there,

If you want to change the order in which fields are serialised, you will need to create an ES3Type and manually change the order of the Write calls to the order you require.

You can do this by going to Window > Easy Save 3 > Types, finding your class, checking the variables you wish to save, and then modifying the order of the Write calls in the ES3Type file it generates (found in Assets > Easy Save 3 > Types.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply