I’m saving various gamestates and properties using playerprefs.
I load these again in my GameManager’s Start() method.
Specifically, I use this for a rank text output in our game. This text is set in the Rank Component’s Start() method.
So, since the string is loaded from file it’s received slightly later, so the text will stay at “”.
If I delay setting the text 0.01 second using a Invoke(“SetRank”, 0.01f), then it works and I get the correct rank.
I wonder what’s the best way of handling loaded properties which are to be used as soon as they are loaded?
The value should be set first after we are sure the value has been received of course, but how to do that? I can think of a number of “hacky” ways of doing it, but if there is a clean way, it would be great.
Thanks!
Kjetil