コード例 #1
0
    public void SaveStat(SavedStat statToSave)
    {
        if (PlayerPrefs.HasKey(statToSave.ToString()))
        {
            PlayerPrefs.SetInt(statToSave.ToString(), PlayerPrefs.GetInt(statToSave.ToString()) + 1);
        }
        else
        {
            PlayerPrefs.SetInt(statToSave.ToString(), 1);
        }

        OnStatSaved();
    }
コード例 #2
0
 public int GetSavedStat(SavedStat stat)
 {
     return PlayerPrefs.GetInt(stat.ToString());
 }