IFileSystem.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. 
  2. namespace YooAsset
  3. {
  4. internal interface IFileSystem
  5. {
  6. /// <summary>
  7. /// 包裹名称
  8. /// </summary>
  9. string PackageName { get; }
  10. /// <summary>
  11. /// 文件根目录
  12. /// </summary>
  13. string FileRoot { get; }
  14. /// <summary>
  15. /// 文件数量
  16. /// </summary>
  17. int FileCount { get; }
  18. /// <summary>
  19. /// 初始化文件系统
  20. /// </summary>
  21. FSInitializeFileSystemOperation InitializeFileSystemAsync();
  22. /// <summary>
  23. /// 加载包裹清单
  24. /// </summary>
  25. FSLoadPackageManifestOperation LoadPackageManifestAsync(string packageVersion, int timeout);
  26. /// <summary>
  27. /// 查询包裹版本
  28. /// </summary>
  29. FSRequestPackageVersionOperation RequestPackageVersionAsync(bool appendTimeTicks, int timeout);
  30. /// <summary>
  31. /// 清理缓存文件
  32. /// </summary>
  33. FSClearCacheFilesOperation ClearCacheFilesAsync(PackageManifest manifest, string clearMode, object clearParam);
  34. /// <summary>
  35. /// 下载Bundle文件
  36. /// </summary>
  37. FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param);
  38. /// <summary>
  39. /// 加载Bundle文件
  40. /// </summary>
  41. FSLoadBundleOperation LoadBundleFile(PackageBundle bundle);
  42. /// <summary>
  43. /// 设置自定义参数
  44. /// </summary>
  45. void SetParameter(string name, object value);
  46. /// <summary>
  47. /// 创建文件系统
  48. /// </summary>
  49. void OnCreate(string packageName, string packageRoot);
  50. /// <summary>
  51. /// 销毁文件系统
  52. /// </summary>
  53. void OnDestroy();
  54. /// <summary>
  55. /// 查询文件归属
  56. /// </summary>
  57. bool Belong(PackageBundle bundle);
  58. /// <summary>
  59. /// 查询文件是否存在
  60. /// </summary>
  61. bool Exists(PackageBundle bundle);
  62. /// <summary>
  63. /// 是否需要下载
  64. /// </summary>
  65. bool NeedDownload(PackageBundle bundle);
  66. /// <summary>
  67. /// 是否需要解压
  68. /// </summary>
  69. bool NeedUnpack(PackageBundle bundle);
  70. /// <summary>
  71. /// 是否需要导入
  72. /// </summary>
  73. bool NeedImport(PackageBundle bundle);
  74. /// <summary>
  75. /// 获取Bundle文件路径
  76. /// </summary>
  77. string GetBundleFilePath(PackageBundle bundle);
  78. /// <summary>
  79. /// 读取Bundle文件的二进制数据
  80. /// </summary>
  81. byte[] ReadBundleFileData(PackageBundle bundle);
  82. /// <summary>
  83. /// 读取Bundle文件的文本数据
  84. /// </summary>
  85. string ReadBundleFileText(PackageBundle bundle);
  86. }
  87. }