I usually do this to increment a PlayerPrefs int:
PlayerPrefs.SetInt (“Int”, PlayerPrefs.GetInt (“Int”) + 1);
I find it very slow and annoying to type.
Is there something like PlayerPrefs.GetInt ("Int") ++; ?
Sorry if this is a stupid question.
Why not write a helper function to do that for you?
public static class PlayerPrefsHelper
{
public static void IncInt(string key)
{
PlayerPrefs.SetInt(key, PlayerPrefs.GetInt(key) + 1);
}
}
Call it like this:
PlayerPrefsHelper.IncInt("Int");
Over time you can end up with tons of these sorts of helper functions that make life a little easier.