Files
YooAssetScene/Assets/YooAsset/Runtime/FileSystem/Operation/FSLoadBundleFileOperation.cs
何冠峰 6254d00bb5 update file system
重构运行时核心代码
2024-12-24 18:23:19 +08:00

48 lines
1.2 KiB
C#

using UnityEngine;
namespace YooAsset
{
internal abstract class FSLoadBundleOperation : AsyncOperationBase
{
/// <summary>
/// 加载结果
/// </summary>
public BundleResult Result { protected set; get; }
/// <summary>
/// 下载进度
/// </summary>
public float DownloadProgress { protected set; get; } = 0;
/// <summary>
/// 下载大小
/// </summary>
public long DownloadedBytes { protected set; get; } = 0;
/// <summary>
/// 终止下载任务
/// </summary>
public abstract void AbortDownloadOperation();
}
internal sealed class FSLoadBundleCompleteOperation : FSLoadBundleOperation
{
private readonly string _error;
internal FSLoadBundleCompleteOperation(string error)
{
_error = error;
}
internal override void InternalOnStart()
{
Status = EOperationStatus.Failed;
Error = _error;
}
internal override void InternalOnUpdate()
{
}
public override void AbortDownloadOperation()
{
}
}
}