public void SetDoubleNameProperty(string sRuneName, string sRuneValue, bool bAddOrReduce, int nType) { string[] sRuneValueArray = ((string)(sRuneValue)).Split(';'); string[] sRuneNameArray = null; if (sRuneValueArray.Length > 1) { sRuneName = sRuneName.Replace("\n", ""); sRuneNameArray = ((string)(sRuneName)).Split(';'); } if (sRuneNameArray != null) { if (sRuneNameArray.Length != sRuneValueArray.Length) { Debug.LogWarning("SetRunePagePointsInfo : runeinfo.csv doubleproperty config is wrong"); return; } } for (int i = 0; i < sRuneValueArray.Length; i++) { string sPropertyName = ""; if (sRuneNameArray == null) { sPropertyName = sRuneName; } else { sPropertyName = sRuneNameArray[i]; } double nRuneProValue = (double.Parse(sRuneValueArray[i])); if (!bAddOrReduce) { nRuneProValue = -nRuneProValue; } double nOldValue = 0; if (uCurRunePageData.dRuneTypeNameTempCount.ContainsKey(sPropertyName)) { nOldValue = uCurRunePageData.dRuneTypeNameTempCount[sPropertyName].typeValue; } else { RuneTypeNameInfo nameInfo = new RuneTypeNameInfo(); nameInfo.nType = nType; uCurRunePageData.dRuneTypeNameTempCount[sPropertyName] = nameInfo; } uCurRunePageData.dRuneTypeNameTempCount[sPropertyName].typeValue = nOldValue + nRuneProValue; } }
public void SetSaveData() { // 覆盖缓存 临时数据->缓存 if (!bIsChanged) { return; } dRuneRecordSlotPoints.Clear(); foreach (int nRuneIdKey in dRuneTempSlotInfo.Keys) { int nPoints = dRuneTempSlotInfo[nRuneIdKey]; // 本地记录缓存 dRuneRecordSlotPoints[nRuneIdKey] = nPoints; } dRuneTypeNameRecordCount.Clear(); foreach (string sRuneName in dRuneTypeNameTempCount.Keys) { double nValue = dRuneTypeNameTempCount[sRuneName].typeValue; int nType = dRuneTypeNameTempCount[sRuneName].nType; // 本地记录缓存 if (dRuneTypeNameRecordCount.ContainsKey(sRuneName)) { dRuneTypeNameRecordCount[sRuneName].typeValue = nValue; dRuneTypeNameRecordCount[sRuneName].nType = nType; } else { RuneTypeNameInfo runeTypeNameInfo = new RuneTypeNameInfo(); runeTypeNameInfo.typeValue = nValue; runeTypeNameInfo.nType = nType; dRuneTypeNameRecordCount[sRuneName] = runeTypeNameInfo; } } sRecordName = sTempName; return; }