コード例 #1
0
    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);
    }
コード例 #2
0
 private static void Events_CommanderEvent(object sender, CommanderInfo e)
 {
     currentSessions.CommanderName = e.Name;
 }