public void SaveLvlByMode(lvlType lvlType, int currLvl) { string saveKey = lvlType.ToString() + lvlSuffix; if (currLvl < 1) { currLvl = 1; } PlayerPrefs.SetInt(saveKey, currLvl); PlayerPrefs.Save(); }
public int LoadLvlByMode(lvlType lvlType) { int lvl = 1; string saveKey = lvlType.ToString() + lvlSuffix; if (PlayerPrefs.HasKey(saveKey)) { lvl = PlayerPrefs.GetInt(saveKey); } if (lvl < 1) { lvl = 1; } return(lvl); }
public void SaveLastGameModePlayed(lvlType lvlPlayed) { PlayerPrefs.SetString(lastPlayedMode, lvlPlayed.ToString()); PlayerPrefs.Save(); }