FSLoadBundleFileOperation.cs 964 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. 
  2. namespace YooAsset
  3. {
  4. internal abstract class FSLoadBundleOperation : AsyncOperationBase
  5. {
  6. /// <summary>
  7. /// 加载结果
  8. /// </summary>
  9. public BundleResult Result { protected set; get; }
  10. /// <summary>
  11. /// 下载进度
  12. /// </summary>
  13. public float DownloadProgress { protected set; get; } = 0;
  14. /// <summary>
  15. /// 下载大小
  16. /// </summary>
  17. public long DownloadedBytes { protected set; get; } = 0;
  18. }
  19. internal sealed class FSLoadBundleCompleteOperation : FSLoadBundleOperation
  20. {
  21. private readonly string _error;
  22. internal FSLoadBundleCompleteOperation(string error)
  23. {
  24. _error = error;
  25. }
  26. internal override void InternalStart()
  27. {
  28. Status = EOperationStatus.Failed;
  29. Error = _error;
  30. }
  31. internal override void InternalUpdate()
  32. {
  33. }
  34. }
  35. }