Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create better way to mark specific PlayerPrefs as persistent #24

Open
yellowberryHN opened this issue Apr 25, 2024 · 0 comments
Open

Create better way to mark specific PlayerPrefs as persistent #24

yellowberryHN opened this issue Apr 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@yellowberryHN
Copy link
Owner

Currently, when you run a New Game or New Game+, there is specific code to wipe your stored data, while storing some data to be used again. Each persistent key is defined as a call to a StoreInfo method, which just seems really messy.

public static void ClearGameData(bool keepMonsters)
{
	int_dic.Clear();
	float_dic.Clear();
	string_dic.Clear();
	StoreInfo("version", version);
	StoreInfoInt("tried_tutorial");
	StoreInfo("volume_master", 0.75f);
	StoreInfo("volume_menu", 1f);
	StoreInfo("volume_ring", 1f);
	StoreInfo("volume_game", 1f);
	StoreInfo("volume_music", 0.5f);
	StoreInfo("volume_vibrate", 0.75f);
	// ...
}

I think instead it would be better to have list of persisted values and just run the required methods in a loop or something.

@yellowberryHN yellowberryHN added the enhancement New feature or request label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant