Reset Game / New Game

Help, support and information for our Game Framework Unity Asset.
If posting about the assets in the extras bundle then please use the appropriate forum.
Post Reply
tenfiddy
Posts: 5
Joined: Wed Jul 24, 2019 9:02 pm

Reset Game / New Game

Post by tenfiddy » Tue Jul 30, 2019 2:30 am

How can I reset the game or start a new game? I want a player to come into my game lobby and be able to select an option for "NEW GAME' - and then, if there is already a current game saved (a warning dialog that the old game will be erased)...and have the ability to start a NEW GAME and erase the data for the old game.

Or have multiple game saves "slots" and be able to select which game the want to load or which slot the want to start a new game in. Hope this makes sense.

We can reset the preferences in the Cheat Function, but how do you do it in game?

Thanks for your response.

BTW - I am giving your app and your help a 5 Star review.

mahewitt
Site Admin
Posts: 252
Joined: Thu May 05, 2016 8:06 pm

Re: Reset Game / New Game

Post by mahewitt » Mon Aug 05, 2019 7:40 pm

Hi. Sorry for the delay in getting back - a few days vacation here :)

That is an interesting question. All settings are saved into Player prefs.

The simplest way is just to GameFramework.Preferences.PreferencesFactory.Instance.DeleteAll() however you then delete everything and might lose other information that you wanted to keep e.g. numberof plays etc. You could also delete keys manually if you know what you are looking for although this might be a bit cumbersome (the naming is fairly logical) e.g. L1.Score for level 1 score etc.

Otherwise at the moment, there is no easy way to reset everything. This comes a bit from the way that things are loaded (before you load a world you might not know what levels it contains). I have added this as a todo item though as I think it will be important to include. If you want to send me an email (details in the readme) then I can work with you on the best way to get this included.

Post Reply