Exemplo n.º 1
0
        private static Dictionary <string, string> ComputeMd5(string folderPath)
        {
            Dictionary <string, string> result = new Dictionary <string, string>();
            string systemPath = UIPrefabProcessor.ToFileSystemPath(folderPath);

            string[]      allFilePaths = Directory.GetFiles(systemPath, "*.*");
            List <string> filePathList = new List <string>();

            foreach (string s in allFilePaths)
            {
                if (s.ToLower().EndsWith(".png") || s.ToLower().EndsWith(".png.meta"))
                {
                    filePathList.Add(s);
                }
            }
            //MD5 md5 = MD5.Create();
            for (int i = 0; i < filePathList.Count; i++)
            {
                string path = filePathList[i];
                //byte[] data = md5.ComputeHash(File.ReadAllBytes(path));
                //result.Add(UIPrefabProcessor.ToAssetPath(path), Convert.ToBase64String(data));
                result.Add(UIPrefabProcessor.ToAssetPath(path), AssetPatchMaker.GetFileLastWriteTime(path));
            }
            return(result);
        }
Exemplo n.º 2
0
        private static string[] GetAssetPaths(string folderPath)
        {
            string systemPath = UIPrefabProcessor.ToFileSystemPath(folderPath);

            string[] filePaths = Directory.GetFiles(systemPath, "*.png");
            string[] result    = new string[filePaths.Length];
            for (int i = 0; i < filePaths.Length; i++)
            {
                result[i] = UIPrefabProcessor.ToAssetPath(filePaths[i]);
            }
            return(result);
        }