Please help how to reset or clear scores to zero like install game for the first time in osx?
hi, i have question maybe someone can help me. how do i clear or reset all memory or cache from my game project? i want to clear all, especially for best time best score that already saved inside my game like fresh from oven ready for distribution? thank you
I already manually delete unity file inside ~/Library/Preferences folder too but when i open the game, the score is exist. So frustate me. Please help. I hope you understand my english.
isnt it so hard to answer? i dont think this need to script, right? i believe the file is somewhere just need to delete but i dont know where is it or which one?
Answer by itsharshdeep · Sep 07, 2016 at 11:52 AM
Hi
PlayerPrefs.DeleteAll ();
//Or
PlayerPrefs.DeleteKey ("yourKey");
Okay, i make it clear first, sorry for my english. I made a game, and i want to record the score everytime the game is over. Just say i already test it manytimes and the score now is 12345 and im done. I want to publish it now, but i need to clear the score to 0 first, right? Because i dont want if i publish it and the score still exist that is 12345. It embarassed me, right? So how do i clear it? Like delete xml file, in somewhere folder?
I don't think so that It will publish with the app .. You can try to test that by deleting the app from your device and do fresh install. If you are working with the player preferences
If you are talking about like Google $$anonymous$$er-board or APIs score clear then you have to login to the server Google Console and there will be a button present reset leaderboard ( IF only you havn't published your leaderboard)
Same for the APIs score posting ask your Web developer to reset the scores on his data base. I will suggest it to keep it as user will think that there are other player that are playing the app.
If you save your score in your code like
PlayerPrefs.SaveInt( "HighScore", GameContoller.Scores);
and other things also , the just Run the command once i.e.
PlayerPrefs.DeleteAll ();
If you have stored your scores on SQLite table even then do not worry because a fresh table will be added in to the app installation. But Do check that you are not adding your scores and values to the database/table which is present in your Asset's folder If yes Then clear that table ( delete the entries of the table)
Following is the screenshot and path which contains the player-prefs https://docs.unity3d.com/ScriptReference/PlayerPrefs.html
For windows see the path here : http://answers.unity3d.com/questions/22088/i-cant-find-playerprefs-on-windows.html
Screenshot : https://www.dropbox.com/s/z5n4n35kst9uuj8/Screen%20Shot%202016-09-08%20at%2012.24.45%20P$$anonymous$$.png?dl=0
Please let me know any of your doubt. ( If I missed something)
Your answer
Follow this Question
Related Questions
Variable being reset to default after being set 1 Answer
How to get the decibel level of a mobile micro (Android/iOS) 0 Answers
On iOS, UnityWebRequest download stops when app goes to background 0 Answers
how do i reset my jump counter? 1 Answer
Mesh colliders stop working after exporting to iOS device. 0 Answers