Beispiel #1
0
 private void Start()
 {
     for (int i = 0; i < m_Chefs.Length; ++i)
     {
         if (SaveManager.HasKey <string>(m_Chefs[i].pName))
         {
             PlayerScoreData scoreData = SaveManager.LoadData <PlayerScoreData>(m_Chefs[i].pName);
             if (scoreData != null)
             {
                 chefsScoreData.Add(m_Chefs[i].pName, scoreData);
             }
         }
     }
 }
Beispiel #2
0
        public void SetScore(string name, int score)
        {
            PlayerScoreData scoreData = null;

            if (!chefsScoreData.ContainsKey(name))
            {
                chefsScoreData.Add(name, new PlayerScoreData());
            }

            chefsScoreData.TryGetValue(name, out scoreData);
            scoreData.scores.Add(score);

            chefsScoreData[name] = scoreData;
            SaveManager.SaveData <PlayerScoreData>(name, scoreData);
        }