Hi guys, i stuck in this ,
i have a some game data which is serialized ,
in my game i have one button that clear all game data, but it is not happening what i want.
If i close the game and reopen it it is happen.
What i want is , how do i clear the data at runtime.
this below line is what i use, for button click
“It doesn’t work” isn’t much to go on, what’s actually the problem?
The code might not even be running, the application might not have permission to read/write etc.
I’d add a print() call next to the call to File.Delete, so you know that the code is actually running when you think it is. If your data is on disk then using System.IO is the way to go.
thx guys , i think thats the problem, the file is opened, i need to first close and then delete…
let me try…
For now what i did means,
I delete Game Data as the code above, then I delete(Destroy) the Game Data Object and then after 0.2 sec i load the loaded level.
So here the game data destroy and create New Game Data after Load Level.