#Debug attempt
1 messages · Page 1 of 1 (latest)
okay
when loading the game i check if the data exists
which if this file exists or not, sets it to a new one or uses the file
In the research (where the bug is) i set some variables
these are the values
mkay
its about the research costs
it creates an array of the costs
so it should create an array that looks around [100, 220, 356, 478] blah blah
right
but i had a function earlier that made an array like [2, 4, 6, 8 ,10] for the costs
because of a different currency
but when i delete the save file (so it resets
and i check the values
it is still the old array
if i replace the Enum with the enum value
oh
like this
so just replacing it with the value
then delete the save file again
to reset
and play the game again
it updates to the correct values
but if i put back the research enum
which is the exact same
that is rlly weird
wtf
i tried restarting unity and everything
that is so friggin weird I got no clue why that would be sorry
yeah, sorry I was of literally no help
no no
you are all good
thank you for listening
And also, just to show i didnt forget to save
if i change it to this
it does update
but if i then change it back
it goes back to what it was
okay so what is serializing?
so you are making a list in a text file, where each line stores information for a new element?
I just read that you can sore stuff on a file using
string content =JsonUtility.ToJson(yourList);
and then
File.WriteAllText("YOURFILE.Dat",Json);
and then for reading you'd use
string content=File.ReadAllText("YOURFILE.Dat",Json);
List<int>yourList=JsonUtility.FromJson<List<int>>(Json);
what does your enum file do?
store my enums
I see bunch of statics
Yeah
Because they shouldnt change after i have set them
That shouldnt be an issue
That is an issue, static does not mean persistent
I can try
You should share your code with proper paste site in #854851968446365696