Beispiel #1
0
 public static void UpdateAssetsInfo(AssetsInfo info)
 {
     if (info == null)
     {
         return;
     }
     PersistentAssetsList[info.AssetName] = info;
 }
Beispiel #2
0
        private static Dictionary <string, AssetsInfo> ParseAssetsList(Stream stream)
        {
            Dictionary <string, AssetsInfo> content = new Dictionary <string, AssetsInfo>();

            if (stream == null)
            {
                return(content);
            }

            StreamReader sr   = new StreamReader(stream);
            string       line = sr.ReadLine();

            while (null != line)
            {
                string[] kv = line.Split('|');
                if (kv != null && kv.Length == 3)
                {
                    string key   = kv[0];
                    string value = kv[1];
                    ulong  size  = ulong.Parse(kv[2]);
                    if (!content.ContainsKey(key))
                    {
                        AssetsInfo info = new AssetsInfo(key, value, size);
                        content.Add(key, info);
                    }
                    else
                    {
                        Debug.LogWarningFormat("Exception Has replicate Asset {0}", kv);
                    }
                }
                else
                {
                    Debug.LogWarningFormat("Exception Line {0}", kv);
                }
                line = sr.ReadLine();
            }

            sr.Close();
            stream.Close();

            return(content);
        }
Beispiel #3
0
 public static void RemoveAssetsInfo(AssetsInfo info)
 {
     PersistentAssetsList.Remove(info.AssetName);
 }