refactor : 重构代码
This commit is contained in:
+11
-12
@@ -1,14 +1,7 @@
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
public abstract class RequestPackageVersionOperation : AsyncOperationBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前最新的包裹版本
|
||||
/// </summary>
|
||||
public string PackageVersion { protected set; get; }
|
||||
}
|
||||
internal sealed class RequestPackageVersionImplOperation : RequestPackageVersionOperation
|
||||
public sealed class RequestPackageVersionOperation : AsyncOperationBase
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
@@ -17,14 +10,20 @@ namespace YooAsset
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly PlayModeImpl _impl;
|
||||
private readonly FileSystemHost _host;
|
||||
private readonly RequestPackageVersionOptions _options;
|
||||
private FSRequestPackageVersionOperation _requestPackageVersionOp;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
internal RequestPackageVersionImplOperation(PlayModeImpl impl, RequestPackageVersionOptions options)
|
||||
/// <summary>
|
||||
/// 当前最新的包裹版本
|
||||
/// </summary>
|
||||
public string PackageVersion { private set; get; }
|
||||
|
||||
|
||||
internal RequestPackageVersionOperation(FileSystemHost host, RequestPackageVersionOptions options)
|
||||
{
|
||||
_impl = impl;
|
||||
_host = host;
|
||||
_options = options;
|
||||
}
|
||||
internal override void InternalStart()
|
||||
@@ -40,7 +39,7 @@ namespace YooAsset
|
||||
{
|
||||
if (_requestPackageVersionOp == null)
|
||||
{
|
||||
var mainFileSystem = _impl.GetMainFileSystem();
|
||||
var mainFileSystem = _host.GetMainFileSystem();
|
||||
_requestPackageVersionOp = mainFileSystem.RequestPackageVersionAsync(_options);
|
||||
_requestPackageVersionOp.StartOperation();
|
||||
AddChildOperation(_requestPackageVersionOp);
|
||||
|
||||
Reference in New Issue
Block a user