Exemplo n.º 1
0
        /*private void Start()
         * {
         *      EnableUI("Testing", MakeList(),false);
         * }*/
        public static List <ScrollData> MakeDataList(string dataPath, string[] filters, UnityAction <string> callback)
        {
            DirectoryInfo di = new DirectoryInfo(dataPath);

            if (di.Exists == false)
            {
                di.Create();
            }
            string[]          list   = filters.SelectMany(f => Directory.GetFiles(dataPath, f)).ToArray();
            List <ScrollData> result = new List <ScrollData>();

            Array.Sort(list);
            for (int i = 0; i < list.Length; i++)
            {
                string     filePath = list[i];
                string     fileName = Path.GetFileName(filePath);
                ScrollData data     = new ScrollData
                {
                    path   = filePath,
                    name   = fileName, // sb.ToString();
                    action = () =>
                                       //callback(FileManager<T>.LoadFile_ZF(filePath), Path.GetFileNameWithoutExtension(filePath), extension),
                             callback(filePath),
                    creationTime = new FileInfo(filePath).CreationTime
                };
                result.Add(data);
            }
            return(result);
        }
Exemplo n.º 2
0
 public void Set(ScrollData d)
 {
     SetActive(true);
     filePath  = d.path;
     data      = d;
     text.text = d.name;
 }