Is stripping needed to go to "low"?

Discussion and help for Easy Save 3
Post Reply
Antonis_Savvidis
Posts: 1
Joined: Fri Jul 09, 2021 11:07 am

Is stripping needed to go to "low"?

Post by Antonis_Savvidis »

First of all WOW What a plugin, I remember using JSON in the old days but since it was years after the last time I manipulated data and I am in SUCH a pressure. I decided to use an asset to make thing simple and it worked!

I have a few questions as reflections is not my cup of tea.
Here is what I did:
I wanna save a scriptable object a very simple one:

Code: Select all

using UnityEngine;
[CreateAssetMenu(fileName = "DataRecord", menuName = "Antonis/DataRecord", order = 2)]

public class DatabaseSO : ScriptableObject
{
    public string[] title = new []{"gr","en","ge"};
    public float latitude, longitude;
    public float range;
    [TextArea(12, 12)]
    public string[] description =  new []{"gr","en","ge"};
}
EDIT: I solved it by removing both [ES3Serializable] & ES3UserType_DatabaseSO but please go ahead and answer my questions below:

At first I used

Code: Select all

[ES3Serializable]
then I went into the type menu and now I also have a ES3UserType_DatabaseSO
1. Was that script created because I went into the type menu or was it the [ES3Serializable] that did this?
2. Was I wrong to do any of those? Would it work automatically too? Should I remove the ES3UserType_DatabaseSO?
3. It does work but I need to set the stripping to LOW to have a file load. Is that normal?
4. I realize that if I want to save I need to have the ES3 Manager on the scene but loading doesn't require that. Correct?
5. Suggestion Add a ES.ClearPesistentDataFiles() method so that we can purge all data from script. I implemented my own.
6. I notice it takes time to show the "Made by Unity" splash logo now (android). Could it be due to this plugin? I can't remember if it did this before.
7. I notice it take 2 scene saves in a row to make the unsaved symbol (*) go away in the inspector. Is this normal?

Once again, kudos for the solid, awesomely structured work mate. I need to find some free time to look into reflections as this
is a great example of those, I also need to figure out how the assembly works fine even thought you have this in plugins folder which should result in a different assembly. Nice tricks you got there.
Last edited by Antonis_Savvidis on Fri Jul 09, 2021 12:01 pm, edited 1 time in total.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Is stripping needed to go to "low"?

Post by Joel »

Hi there,
Was that script created because I went into the type menu or was it the [ES3Serializable] that did this?
This was created because you made changes in the Types window.
Was I wrong to do any of those? Would it work automatically too? Should I remove the ES3UserType_DatabaseSO?
Your ScriptableObject is serializable by default so you don't need to add an ES3Serializable attribute of an ES3Type for it. For more information please see the Supported Types guide:

http://docs.moodkie.com/easy-save-3/es3 ... ted-types/
It does work but I need to set the stripping to LOW to have a file load. Is that normal?
This will be because a required class is being stripped when you set stripping to a higher level.
I realize that if I want to save I need to have the ES3 Manager on the scene but loading doesn't require that. Correct?
You need a manager in the scene if you're using Auto Save, or you're saving/loading any reference types.
Suggestion Add a ES.ClearPesistentDataFiles() method so that we can purge all data from script. I implemented my own.
We only include methods which are very regularly used to ensure that the API doesn't become bloated. However, you can use ES3.DeleteDirectory, or using the following code if you don't want to remove the entire folder:

Code: Select all

foreach(var file in ES3.GetFilenames())
    ES3.DeleteFile(file);
All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply