Exemplo n.º 1
0
    public void SaveLvlByMode(lvlType lvlType, int currLvl)
    {
        string saveKey = lvlType.ToString() + lvlSuffix;

        if (currLvl < 1)
        {
            currLvl = 1;
        }

        PlayerPrefs.SetInt(saveKey, currLvl);
        PlayerPrefs.Save();
    }
Exemplo n.º 2
0
    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);
    }
Exemplo n.º 3
0
 public void SaveLastGameModePlayed(lvlType lvlPlayed)
 {
     PlayerPrefs.SetString(lastPlayedMode, lvlPlayed.ToString());
     PlayerPrefs.Save();
 }