| | |
| | | }
|
| | | } |
| | | |
| | | public bool CheckLocalFileValid()
|
| | | public bool CheckLocalFileValid(bool _completeFile)
|
| | | {
|
| | | if (extersion == ".manifest" || extersion == ".bytes" || extersion == ".txt" || extersion == ".dll")
|
| | | if (_completeFile)
|
| | | {
|
| | | var path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, m_RelativePath);
|
| | | var fileInfo = new FileInfo(path);
|
| | |
|
| | | if (!fileInfo.Exists || fileInfo.Length != size || md5 != FileExtersion.GetMD5HashFromFile(path))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | else if (string.IsNullOrEmpty(extersion) || extersion.Length == 0)
|
| | | {
|
| | | var path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, m_RelativePath);
|
| | | var fileInfo = new FileInfo(path);
|
| | |
|
| | | var manifestAssetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact(m_RelativePath, ".manifest"));
|
| | | if (!fileInfo.Exists || fileInfo.Length != size || manifestAssetVersion == null || !manifestAssetVersion.CheckLocalFileValid())
|
| | | {
|
| | | return false;
|
| | | }
|
| | | return fileInfo.Exists && fileInfo.Length == size && md5 == FileExtersion.GetMD5HashFromFile(path);
|
| | | }
|
| | | else
|
| | | {
|
| | | var path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, m_RelativePath);
|
| | | var fileInfo = new FileInfo(path);
|
| | | if (!fileInfo.Exists || fileInfo.Length != size)
|
| | | if (extersion == ".manifest" || extersion == ".bytes" || extersion == ".txt" || extersion == ".dll")
|
| | | {
|
| | | return false;
|
| | | var path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, m_RelativePath);
|
| | | var fileInfo = new FileInfo(path);
|
| | |
|
| | | if (!fileInfo.Exists || fileInfo.Length != size || md5 != FileExtersion.GetMD5HashFromFile(path))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | else if (string.IsNullOrEmpty(extersion) || extersion.Length == 0)
|
| | | {
|
| | | var path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, m_RelativePath);
|
| | | var fileInfo = new FileInfo(path);
|
| | |
|
| | | var manifestAssetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact(m_RelativePath, ".manifest"));
|
| | | if (!fileInfo.Exists || fileInfo.Length != size || manifestAssetVersion == null || !manifestAssetVersion.CheckLocalFileValid(false))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | var path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, m_RelativePath);
|
| | | var fileInfo = new FileInfo(path);
|
| | | if (!fileInfo.Exists || fileInfo.Length != size)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|