public static void GenerateAllConfigfile() { var path = Application.dataPath + "/streamingAssets"; if (Directory.Exists(path)) { DirectoryInfo direction = new DirectoryInfo(path); // FileInfo[] files = direction.GetFiles("*.txt", SearchOption.AllDirectories); List <string> l = new List <string> (); NamePathDataType data = new NamePathDataType(); for (int i = 0; i < files.Length; i++) { if (files[i].Name.EndsWith(".meta")) { continue; } l.Add(files[i].Name); data.Name = files[i].Name; data.Path = files[i].DirectoryName; // Debug.Log ("Name : " + files[i].Name); // Debug.Log ("FullName : " + files[i].FullName); // Debug.Log ("DirectoryName : " + files[i].DirectoryName); } File.WriteAllLines("Assets/StreamingAssets/AllConfigrationFile.txt", l.ToArray()); AssetDatabase.Refresh(); } }
public void SpriteConfigAss(JsonData _jd) { m_spriteConfigDic = new Dictionary <string, NamePathDataType> (); foreach (JsonData elem in _jd) { NamePathDataType table = new NamePathDataType(); table.Name = elem["Name"].ToString(); table.Path = elem["Path"].ToString(); m_spriteConfigDic[table.Name] = table; } }