public void LoadLeaderboard() { string infos = TrinaxPlayerPrefs.GetString(LB_PREFSTRING, ""); string[] tempInfos = infos.Split(','); for (int i = 0; i < tempInfos.Length - 2; i += 2) { LocalPlayerInfo loadedInfo = new LocalPlayerInfo(tempInfos[i], int.Parse(tempInfos[i + 1])); infoList.Add(loadedInfo); UpdateHUD(); } }
void UpdatePlayerPrefs() { string info = ""; for (int i = 0; i < infoList.Count; i++) { info += infoList[i].name + ","; info += infoList[i].score + ","; } TrinaxPlayerPrefs.SetString(LB_PREFSTRING, info, true); UpdateHUD(); }
public void Clear() { TrinaxPlayerPrefs.DeleteKey(LB_PREFSTRING); infoList.Clear(); display.text = ""; }