/// <summary> /// Game Save /// </summary> /// <returns></returns> public AssmeblePartSingleSaveData CreatePartSave() { Dictionary <string, AssmeblePartCustomSaveData> proDic = new Dictionary <string, AssmeblePartCustomSaveData>(); foreach (var customData in customDataInfo.propertyDic.Values) { AssmeblePartCustomSaveData saveData = new AssmeblePartCustomSaveData( partID, customData.propertyName, customData.propertyValueMin, customData.propertyValueMax, customData.detailInfoDic, customData.timeCostDetailInfoDic); proDic.Add(saveData.propertyName, saveData); } AssmeblePartSingleSaveData save = new AssmeblePartSingleSaveData(partID, UID, customDataInfo.partNameCustomText, customDataInfo.customValueDic, proDic); return(save); }
/// <summary> /// GameSave /// </summary> /// <param name="saveData"></param> public bool LoadCustomDataSave(AssmeblePartCustomSaveData saveData) { var config = AssembleModule.GetPartsPropertyConfigData(saveData.partID); if (config != null) { var proConfig = config.configData.Find(x => x.Name == saveData.propertyName); if (proConfig != null) { CustomData data = new CustomData(); data.InitData(proConfig); propertyValueMin = saveData.propertyValueMin; propertyValueMax = saveData.propertyValueMax; detailInfoDic = saveData.detailInfoDic; timeCostDetailInfoDic = saveData.timeCostDetailInfoDic; return(true); } } return(false); }