After reading, the Text font will disappear

Discussion and help for Easy Save 3
Post Reply
EasySave3Learner
Posts: 1
Joined: Sat Jun 04, 2022 12:16 am

After reading, the Text font will disappear

Post by EasySave3Learner »

Hi, Joel, sorry, my english is poor, this is machine translation
The problem is this:

Code: Select all

    private void OnGUI()//
    {
        if (GUILayout.Button("Add cat"))//①press 1 time
        {
            GenerateText(0);
        }
        if (GUILayout.Button("Add dog"))//①press 1 time
        {
            GenerateText(1);
        }
        if (GUILayout.Button("Save"))//②press     //③Stop and replay
        {
            Save();
        }
        if (GUILayout.Button("Load"))//④press
        {
            Load();//After reading, the Text font will disappear, you can click on the object of the level panel to see related information
        }

    }

    private void GenerateText(int id)
    {
        GameObject textGO = Instantiate(prefabList[id],transform);    //public List<GameObject> prefabList;
        textGOList.Add(textGO);//    public List<GameObject> textGOList;
    }

    private void Save()
    {
        ES3.Save("textGOList",textGOList);
    }

    private void Load()
    {
        textGOList = ES3.Load<List<GameObject>>("textGOList");
    }
Please see attachment for details
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: After reading, the Text font will disappear

Post by Joel »

Hi there, and thanks for getting in contact.

I've deleted your attachment as it contained the Easy Save asset and would allow anyone to download it, which is against the EULA. In the future if you could private message projects that would be appreciated.

Regarding your issue, the reason for this is because your prefabs have not been enabled for Easy Save, so it's forced to try to recreate the GameObjects from the serialised data alone rather than using a prefab instance to fill in the gaps. As Unity Fonts cannot be serialized, the font will not be loaded.

In this case following the Saving and Loading Prefab Instances instructions will resolve your issue:
https://docs.moodkie.com/easy-save-3/es ... 0instances

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