public static void SaveToolDataStatus(ToolSaveData saveData) { List <ToolSaveData> oldDatas = LoadToolDataStatus(); ToolSaveData oldData = oldDatas.Find(y => saveData.name == y.name); if (oldData != null) { oldData.SetValue(saveData); } else { oldDatas.Add(saveData); } SaveDataList(oldDatas); }
public static void SaveToolDataStatus(List <ToolSaveData> saveDataList) { List <ToolSaveData> oldDatas = LoadToolDataStatus(); saveDataList.ForEach(x => { ToolSaveData oldData = oldDatas.Find(y => x.name == y.name); if (oldData != null) { oldData.SetValue(x); } else { oldDatas.Add(x); } }); SaveDataList(oldDatas); }