Saving and loading text/tmpugui

Discussion and help for Easy Save 3
Post Reply
Squashyyy
Posts: 3
Joined: Tue Apr 28, 2020 6:32 pm

Saving and loading text/tmpugui

Post by Squashyyy »

Hi again,

What I'm trying to do is to save a TMPUGUI text by:

Code: Select all

public TextMeshProUGUI test1
Then I use the save and load codes, the issue is that when I do this with the Textmeshpro then it deletes the reference. I have my text referenced to a gamemanager and for whatever reason it keeps deleting it when it's executing the load command.

The only error I get is because of my code

Code: Select all

test1.enabled = false;
then a coroutine that's supposed to make it to true, it just tells me that I don't have a reference. Basically I have a "prestige" button so whenever you click it then it should change the text from test1 too test2 and then get saved as test2 when I press the play button again, but it doesn't. And as you guessed by now that's because the refence gets deleted in playmode. I tried checking around ES3 windows --> Types, but couldn't find anything that was of help.

Later on I tried doing this with the normal text component that unity has & it still kept deleting my reference. Which made me believe that there might be something wrong with the asset & not my codes sooo that's why I'm here again.

The saving and loading code that I'm using is:

Code: Select all

ES3.Save<TextMeshProUGUI>("mytest1", test1);

Code: Select all

test1 = ES3.Load<TextMeshProUGUI>("mytest1");
-Squashyyy
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving and loading text/tmpugui

Post by Joel »

Hi there,

Would you be able to create a new project which replicates this and private message it to me with instructions? Preferably using Unity's Text Component rather than TextMeshPro.

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