Hello guys
I have a class where I store save data of the current carrier.
I developed the game as the user can have multiple carriers, so multiple save datas.
Everything is going fine.
But I have a little problem when loading.
When I save it save everything correct, I am sure because the Debug Logs confirm it.
Also when I load the Debug Logs confirm that I have saved correclty.
But the big problem is when it load to the class.
It load all save datas, but do this strange thing:
It overright all previous savedata by the current.
I am looping to load all save datas, and it overright all previous save datas!
What may be this problem? I am trouble shooting from a week!
Thanks guys, see you byeeeee
Yes, I have tested the problem is when it loads, because it overwrite the previous class of the array.
After the loading I have tried to put a loop which debug logs two variable of the class of I and the same two variable of player prefs of I
for (var i : int = 0; i < class.Length; i ++)
Debug.Logs (class_.var1 + " " + class*.var2 + " VS " + PlayerPrefs(i+“var1”) + " " + PlayerPrefs(i+“var2”));*_
And I got that the class var1 and var2 are the same of the last class of the array, while the PlayerPrefs var1 and var2 are correct.
So the problem is when it loads that overwrite the previous data!!!
I have also checked the hole script and also deleted it and remade, but I got the same problem!
What should I do?
…for example you could start by posting here the class code and how you’re loading it ![]()
Please use code tags (go advanced) and post your code and issue in a clearer manner. I can’t really see the problem at the moment.