| | |
| | | using UnityEngine; |
| | | using System.IO; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace LaunchCommon |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public bool CheckLocalFileValid() |
| | | //checkList 用于外部检查文件下载后是否一致,不包含没有文件的情况 |
| | | public bool CheckLocalFileValid(List<bool> checkList = null) |
| | | { |
| | | string path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, m_RelativePath); |
| | | var fileInfo = new FileInfo(path); |
| | |
| | | } |
| | | if (fileInfo.Length != size) |
| | | { |
| | | if (checkList != null && checkList.Count == 0) |
| | | { |
| | | checkList.Add(false); |
| | | } |
| | | Debug.LogFormat("{0}文件大小不对{1}-{2}", path, size, fileInfo.Length); |
| | | return false; |
| | | } |
| | | var fileMD5 = FileExtersion.GetMD5HashFromFile(path); |
| | | if (fileMD5 != md5) |
| | | { |
| | | if (checkList != null && checkList.Count == 0) |
| | | { |
| | | checkList.Add(false); |
| | | } |
| | | Debug.LogFormat("{0}文件md5不对{1}-{2}", path, md5, fileMD5); |
| | | return false; |
| | | } |