public void SaveCommanderInfo() { string path = $"{Application.persistentDataPath}/commander_info.json"; var arr = new CommanderInfo[dicCommanderinfo.Count]; int i = 0; foreach (var commanderInfo in dicCommanderinfo) { arr[i] = commanderInfo.Value; i++; } string json = JsonConvert.SerializeObject(arr); File.WriteAllText(path, json); }
private static void Events_CommanderEvent(object sender, CommanderInfo e) { currentSessions.CommanderName = e.Name; }