VerifyFileElement.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System.IO;
  2. namespace YooAsset
  3. {
  4. internal class VerifyFileElement
  5. {
  6. public string PackageName { private set; get; }
  7. public string BundleGUID { private set; get; }
  8. public string FileRootPath { private set; get; }
  9. public string DataFilePath { private set; get; }
  10. public string InfoFilePath { private set; get; }
  11. public string DataFileCRC;
  12. public long DataFileSize;
  13. /// <summary>
  14. /// 注意:原子操作对象
  15. /// </summary>
  16. public volatile int Result = 0;
  17. public VerifyFileElement(string packageName, string bundleGUID, string fileRootPath, string dataFilePath, string infoFilePath)
  18. {
  19. PackageName = packageName;
  20. BundleGUID = bundleGUID;
  21. FileRootPath = fileRootPath;
  22. DataFilePath = dataFilePath;
  23. InfoFilePath = infoFilePath;
  24. }
  25. public void DeleteFiles()
  26. {
  27. try
  28. {
  29. Directory.Delete(FileRootPath, true);
  30. }
  31. catch (System.Exception e)
  32. {
  33. YooLogger.Warning($"Failed to delete cache bundle folder : {e}");
  34. }
  35. }
  36. }
  37. }