コード例 #1
0
ファイル: AssetPathRefManager.cs プロジェクト: uiopsczc/Test
 public void Add(string guid)
 {
     if (dict.ContainsKey(guid))
     {
         dict[guid].Refresh();
     }
     else
     {
         refId++;
         dict[guid] = new AssetPathRef(refId, null, guid);
     }
 }
コード例 #2
0
ファイル: AssetPathRefManager.cs プロジェクト: uiopsczc/Test
        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);
            }
        }