Hello,
I would like to know if the asset does need to know all component information internally before building the game or if it can handle runtime provided information?
I ask this because my game has runtime assembly injection via a modding system and I would like to also offer save support for that code.
The 2 possibilities to allow the saving of data according to the documentation are by using the ES3Serialiable attribute or custom types.
The custom types are obviously not possible in my case. I may be able to provide modders access to the attribute by creating a duplicate of it with only its defintion in the modding API but that would require the internal structure of EasySave to be able to act on external code using that attribute?
Thanks,
CitrioN
Question regarding internal save structure
Re: Question regarding internal save structure
Hi there,
If you’re not using ES3Types, Easy Save simply looks for the field with the given name in the class and loads into this. In this sense it works with dynamically-loaded objects.
However, the field would need to adhere to the criteria specified in the Supported Types guide:
https://docs.moodkie.com/easy-save-3/es ... ted-types/
All the best,
Joel
If you’re not using ES3Types, Easy Save simply looks for the field with the given name in the class and loads into this. In this sense it works with dynamically-loaded objects.
However, the field would need to adhere to the criteria specified in the Supported Types guide:
https://docs.moodkie.com/easy-save-3/es ... ted-types/
All the best,
Joel
Re: Question regarding internal save structure
Hello Joel,
thanks for the quick reply. Follow up question after I did some testing.
Unless I create an ES3Type for a monobehaviour I don't see it being saved.
Is there an option to enable all monobehaviours to be saved for a gameobject or do I need to manually query all monobehaviours I want to save from an object and save them manually?
Thanks,
CitrioN
thanks for the quick reply. Follow up question after I did some testing.
Unless I create an ES3Type for a monobehaviour I don't see it being saved.
Is there an option to enable all monobehaviours to be saved for a gameobject or do I need to manually query all monobehaviours I want to save from an object and save them manually?
Thanks,
CitrioN
Re: Question regarding internal save structure
Hi there,
If you're saving an entire GameObject then only MonoBehaviours with an ES3Type are stored (see https://docs.moodkie.com/easy-save-3/es ... s-prefabs/).
If you also wanted MonoBehaviours with the ES3Serializable attribute to be stored, you would need to uncomment the commented part of the following line of the Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs file:
You can remove the line entirely to serialize all Components, but not all Components are serializable at runtime so this is strongly recommended against and we would not be able to support this.
All the best,
Joel
If you're saving an entire GameObject then only MonoBehaviours with an ES3Type are stored (see https://docs.moodkie.com/easy-save-3/es ... s-prefabs/).
If you also wanted MonoBehaviours with the ES3Serializable attribute to be stored, you would need to uncomment the commented part of the following line of the Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs file:
Code: Select all
if(ES3TypeMgr.GetES3Type(componentType) != null /*|| ES3Reflection.AttributeIsDefined(componentType, ES3Reflection.serializableAttributeType)*/)
All the best,
Joel