ES3 Not saving basic components on GameObjects

Discussion and help for Easy Save 3
Post Reply
Kyper
Posts: 9
Joined: Sat Jun 18, 2022 8:11 pm

ES3 Not saving basic components on GameObjects

Post by Kyper »

I have a gameobject that has several Monobehaviours with basic native fields.

According to the documentation, this should be able to save and load without any additional work. I am drawing this conclusion from the following statements in the documentation:

"Easy Save can automatically save the following types: [Components/MonoBehaviours]"
and
"A field in a supported class will be serialized if it: [Is public, or has a [SerializeField] attribute]"

However, when I save and load, it only has the transform and some other basic stuff. When I inspect the save file, I can confirm that it is indeed not including the basic monobehaviour scripts in the list of components.

Simplified sample that doesn't seem to be working for me:

Code: Select all

public class TestSaveV : MonoBehaviour
{

    [SerializeField]
    private string test;
}
Kyper
Posts: 9
Joined: Sat Jun 18, 2022 8:11 pm

Re: ES3 Not saving basic components on GameObjects

Post by Kyper »

For anyone reading this. I did find a similar question and an answer from the developer.

https://moodkie.com/forum/viewtopic.php ... ours#p9766


It would be REALLY nice to have an officially supported way to do this. It cuts back on an absurd amount of time.

Edit: Though it seems this potentially breaks deserializing some e3prefabs? I will post back here if I solve this or if I find out this is an incorrect statement.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: ES3 Not saving basic components on GameObjects

Post by Joel »

Hi there,

We intentionally don't serialise these Components because the Serializable attribute indicates that it's Editor-serializable in Unity, but not necessarily runtime serializable. Saving something which isn't serializable at runtime will cause unexpected behaviour and often a hard crash.

For more information on what will be saved on a GameObject please see the Saving and Loading GameObjects guide:

https://docs.moodkie.com/easy-save-3/es ... s-prefabs/
This will save and load the following:

layer, tag, name and hideFlags.
Components on the Natively-supported types list, or those which have been manually supported using an ES3Type.
All of the above for every child of the GameObject.
All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply