public void SetLevel(string name, int level) { if (CustomerLevel.ContainsKey(name)) { CustomerLevel[name] = level; } else { CustomerLevel.Add(name, level); } }
public void SetExp(string name, int exp) { if (CustomerLevel.ContainsKey(name)) { CustomerLevel[name] = exp; } else { CustomerLevel.Add(name, exp); } }
void LoadLevel() { int count = PlayerPrefs.GetInt(nameof(CustomerCount)); CustomerLevel.Clear(); for (int i = 0; i < count; i++) { string key = PlayerPrefs.GetString($"Customer{i}Level"); if (string.IsNullOrEmpty(key)) { continue; } int value = PlayerPrefs.GetInt(key); CustomerLevel.Add(key, value); } }