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); }
//增加到dic中 static void HandleFileMetaToDic(string metafile, CDicMeta dicMetas) { Meta_t v = Meta_t.FromFile(metafile); if (v != null) { dicMetas.Add(v.uuid, v); } }
public bool TryGetValue(string k, out Meta_t v) { return(dic.TryGetValue(k, out v)); }
public void Add(string k, Meta_t v) { dic.Add(k, v); }
public override void OnLoad() { m_meta = Meta_t.FromFile(candi.Location + ".meta"); }