public void Add(string guid) { if (dict.ContainsKey(guid)) { dict[guid].Refresh(); } else { refId++; dict[guid] = new AssetPathRef(refId, null, guid); } }
public void Load(string contentJson) { dict.Clear(); Hashtable jsonDict = MiniJson.JsonDecode(contentJson) as Hashtable; refId = jsonDict.Get <long>("ref_id"); ArrayList assetPathRefList = jsonDict.Get <ArrayList>("assetPathRef_list"); for (var i = 0; i < assetPathRefList.Count; i++) { var assetPathRefDict = (Hashtable)assetPathRefList[i]; long refId = assetPathRefDict.Get <long>("ref_id"); string assetPath = assetPathRefDict.Get <string>("assetPath"); string guid = assetPathRefDict.Get <string>("guid"); if (refId > this.refId) { this.refId = refId; } dict[guid] = new AssetPathRef(refId, assetPath, guid); } }