예제 #1
0
        public static Meta_t FromFile(string metafn)
        {
            //目录的话,就不要处理了
            string reffile = metafn.Substring(0, metafn.LastIndexOf(".meta"));

            if (Directory.Exists(reffile))
            {
                return(null);
            }
            //string key = metafile.Substring(metafile.IndexOf("Assets"));
            Meta_t v = new Meta_t();

            v.fn = reffile;
            //fileFormatVersion: 2
            //guid: 7d6e24a13990b6549b206d11106e445a
            try
            {
                string[] ll = File.ReadAllLines(metafn);
                for (int i = 0; i < ll.Length; ++i)
                {
                    int pos = ll[i].IndexOf("guid: ");
                    if (pos != -1)
                    {
                        v.uuid = ll[i].Substring(6);
                        break;
                    }
                }
            }
            catch (Exception e)
            {
            }
            return(v);
        }
예제 #2
0
        //增加到dic中
        static void HandleFileMetaToDic(string metafile, CDicMeta dicMetas)
        {
            Meta_t v = Meta_t.FromFile(metafile);

            if (v != null)
            {
                dicMetas.Add(v.uuid, v);
            }
        }
예제 #3
0
 public bool TryGetValue(string k, out Meta_t v)
 {
     return(dic.TryGetValue(k, out v));
 }
예제 #4
0
 public void Add(string k, Meta_t v)
 {
     dic.Add(k, v);
 }
예제 #5
0
 public override void OnLoad()
 {
     m_meta = Meta_t.FromFile(candi.Location + ".meta");
 }