mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-27 19:20:09 +00:00
update file system
This commit is contained in:
@@ -9,46 +9,109 @@ namespace YooAsset
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑器下模拟模式
|
||||
/// 通用类
|
||||
/// </summary>
|
||||
internal sealed class EditorSimulateModeClearAllBundleFilesOperation : ClearAllBundleFilesOperation
|
||||
internal sealed class DefaultClearAllBundleFilesOperation : ClearAllBundleFilesOperation
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
None,
|
||||
ClearAllBundleFiles,
|
||||
ClearFileSystemA,
|
||||
ClearFileSystemB,
|
||||
ClearFileSystemC,
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly EditorSimulateModeImpl _impl;
|
||||
private FSClearAllBundleFilesOperation _clearAllBundleFilesOp;
|
||||
private readonly IPlayMode _impl;
|
||||
private readonly IFileSystem _fileSystemA;
|
||||
private readonly IFileSystem _fileSystemB;
|
||||
private readonly IFileSystem _fileSystemC;
|
||||
private FSClearAllBundleFilesOperation _clearAllBundleFilesOpA;
|
||||
private FSClearAllBundleFilesOperation _clearAllBundleFilesOpB;
|
||||
private FSClearAllBundleFilesOperation _clearAllBundleFilesOpC;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
internal EditorSimulateModeClearAllBundleFilesOperation(EditorSimulateModeImpl impl)
|
||||
internal DefaultClearAllBundleFilesOperation(IPlayMode impl, IFileSystem fileSystemA, IFileSystem fileSystemB, IFileSystem fileSystemC)
|
||||
{
|
||||
_impl = impl;
|
||||
_fileSystemA = fileSystemA;
|
||||
_fileSystemB = fileSystemB;
|
||||
_fileSystemC = fileSystemC;
|
||||
}
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
_steps = ESteps.ClearAllBundleFiles;
|
||||
_steps = ESteps.ClearFileSystemA;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||
return;
|
||||
|
||||
if (_steps == ESteps.ClearAllBundleFiles)
|
||||
if (_steps == ESteps.ClearFileSystemA)
|
||||
{
|
||||
if (_clearAllBundleFilesOp == null)
|
||||
{
|
||||
_clearAllBundleFilesOp = _impl.EditorFileSystem.ClearAllBundleFilesAsync();
|
||||
}
|
||||
if (_clearAllBundleFilesOpA == null)
|
||||
_clearAllBundleFilesOpA = _fileSystemA.ClearAllBundleFilesAsync();
|
||||
|
||||
Progress = _clearAllBundleFilesOp.Progress;
|
||||
if (_clearAllBundleFilesOp.IsDone == false)
|
||||
Progress = _clearAllBundleFilesOpA.Progress;
|
||||
if (_clearAllBundleFilesOpA.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearAllBundleFilesOp.Status == EOperationStatus.Succeed)
|
||||
if (_clearAllBundleFilesOpA.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.ClearFileSystemB;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearAllBundleFilesOpA.Error;
|
||||
}
|
||||
}
|
||||
|
||||
if (_steps == ESteps.ClearFileSystemB)
|
||||
{
|
||||
if (_fileSystemB == null)
|
||||
{
|
||||
_steps = ESteps.ClearFileSystemC;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_clearAllBundleFilesOpB == null)
|
||||
_clearAllBundleFilesOpB = _fileSystemB.ClearAllBundleFilesAsync();
|
||||
|
||||
Progress = _clearAllBundleFilesOpB.Progress;
|
||||
if (_clearAllBundleFilesOpB.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearAllBundleFilesOpB.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.ClearFileSystemC;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearAllBundleFilesOpB.Error;
|
||||
}
|
||||
}
|
||||
|
||||
if (_steps == ESteps.ClearFileSystemC)
|
||||
{
|
||||
if (_fileSystemC == null)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_clearAllBundleFilesOpC == null)
|
||||
_clearAllBundleFilesOpC = _fileSystemC.ClearAllBundleFilesAsync();
|
||||
|
||||
Progress = _clearAllBundleFilesOpC.Progress;
|
||||
if (_clearAllBundleFilesOpC.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearAllBundleFilesOpC.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
@@ -57,228 +120,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearAllBundleFilesOp.Error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 离线运行模式
|
||||
/// </summary>
|
||||
internal sealed class OfflinePlayModeClearAllBundleFilesOperation : ClearAllBundleFilesOperation
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
None,
|
||||
ClearAllBundleFiles,
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly OfflinePlayModeImpl _impl;
|
||||
private FSClearAllBundleFilesOperation _clearAllBundleFilesOp;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
internal OfflinePlayModeClearAllBundleFilesOperation(OfflinePlayModeImpl impl)
|
||||
{
|
||||
_impl = impl;
|
||||
}
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
_steps = ESteps.ClearAllBundleFiles;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||
return;
|
||||
|
||||
if (_steps == ESteps.ClearAllBundleFiles)
|
||||
{
|
||||
if (_clearAllBundleFilesOp == null)
|
||||
{
|
||||
_clearAllBundleFilesOp = _impl.BuildinFileSystem.ClearAllBundleFilesAsync();
|
||||
}
|
||||
|
||||
Progress = _clearAllBundleFilesOp.Progress;
|
||||
if (_clearAllBundleFilesOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearAllBundleFilesOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearAllBundleFilesOp.Error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 联机运行模式
|
||||
/// </summary>
|
||||
internal sealed class HostPlayModeClearAllBundleFilesOperation : ClearAllBundleFilesOperation
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
None,
|
||||
ClearBuildinAllBundleFiles,
|
||||
ClearDeliveryAllBundleFiles,
|
||||
ClearCacheAllBundleFiles,
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly HostPlayModeImpl _impl;
|
||||
private FSClearAllBundleFilesOperation _clearBuildinAllBundleFilesOp;
|
||||
private FSClearAllBundleFilesOperation _clearDeliveryAllBundleFilesOp;
|
||||
private FSClearAllBundleFilesOperation _clearCacheAllBundleFilesOp;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
internal HostPlayModeClearAllBundleFilesOperation(HostPlayModeImpl impl)
|
||||
{
|
||||
_impl = impl;
|
||||
}
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
_steps = ESteps.ClearBuildinAllBundleFiles;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||
return;
|
||||
|
||||
if (_steps == ESteps.ClearBuildinAllBundleFiles)
|
||||
{
|
||||
if (_clearBuildinAllBundleFilesOp == null)
|
||||
{
|
||||
_clearBuildinAllBundleFilesOp = _impl.BuildinFileSystem.ClearAllBundleFilesAsync();
|
||||
}
|
||||
|
||||
Progress = _clearBuildinAllBundleFilesOp.Progress;
|
||||
if (_clearBuildinAllBundleFilesOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearBuildinAllBundleFilesOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.ClearDeliveryAllBundleFiles;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearBuildinAllBundleFilesOp.Error;
|
||||
}
|
||||
}
|
||||
|
||||
if (_steps == ESteps.ClearDeliveryAllBundleFiles)
|
||||
{
|
||||
if (_impl.DeliveryFileSystem == null)
|
||||
{
|
||||
_steps = ESteps.ClearCacheAllBundleFiles;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_clearDeliveryAllBundleFilesOp == null)
|
||||
{
|
||||
_clearDeliveryAllBundleFilesOp = _impl.DeliveryFileSystem.ClearAllBundleFilesAsync();
|
||||
}
|
||||
|
||||
Progress = _clearDeliveryAllBundleFilesOp.Progress;
|
||||
if (_clearDeliveryAllBundleFilesOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearDeliveryAllBundleFilesOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.ClearCacheAllBundleFiles;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearDeliveryAllBundleFilesOp.Error;
|
||||
}
|
||||
}
|
||||
|
||||
if (_steps == ESteps.ClearCacheAllBundleFiles)
|
||||
{
|
||||
if (_clearCacheAllBundleFilesOp == null)
|
||||
{
|
||||
_clearCacheAllBundleFilesOp = _impl.CacheFileSystem.ClearAllBundleFilesAsync();
|
||||
}
|
||||
|
||||
Progress = _clearCacheAllBundleFilesOp.Progress;
|
||||
if (_clearCacheAllBundleFilesOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearCacheAllBundleFilesOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearCacheAllBundleFilesOp.Error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WebGL运行模式
|
||||
/// </summary>
|
||||
internal sealed class WebPlayModeClearAllBundleFilesOperation : ClearAllBundleFilesOperation
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
None,
|
||||
ClearAllBundleFiles,
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly WebPlayModeImpl _impl;
|
||||
private FSClearAllBundleFilesOperation _clearAllBundleFilesOp;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
internal WebPlayModeClearAllBundleFilesOperation(WebPlayModeImpl impl)
|
||||
{
|
||||
_impl = impl;
|
||||
}
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
_steps = ESteps.ClearAllBundleFiles;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||
return;
|
||||
|
||||
if (_steps == ESteps.ClearAllBundleFiles)
|
||||
{
|
||||
if (_clearAllBundleFilesOp == null)
|
||||
{
|
||||
_clearAllBundleFilesOp = _impl.WebFileSystem.ClearAllBundleFilesAsync();
|
||||
}
|
||||
|
||||
Progress = _clearAllBundleFilesOp.Progress;
|
||||
if (_clearAllBundleFilesOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearAllBundleFilesOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearAllBundleFilesOp.Error;
|
||||
Error = _clearAllBundleFilesOpC.Error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,46 +9,110 @@ namespace YooAsset
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑器下模拟模式
|
||||
/// 通用类
|
||||
/// </summary>
|
||||
internal sealed class EditorSimulateModeClearUnusedBundleFilesOperation : ClearUnusedBundleFilesOperation
|
||||
internal sealed class DefaultClearUnusedBundleFilesOperation : ClearUnusedBundleFilesOperation
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
None,
|
||||
ClearUnusedBundleFiles,
|
||||
ClearFileSystemA,
|
||||
ClearFileSystemB,
|
||||
ClearFileSystemC,
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly EditorSimulateModeImpl _impl;
|
||||
private FSClearUnusedBundleFilesOperation _clearUnusedBundleFilesOp;
|
||||
private readonly IPlayMode _impl;
|
||||
private readonly IFileSystem _fileSystemA;
|
||||
private readonly IFileSystem _fileSystemB;
|
||||
private readonly IFileSystem _fileSystemC;
|
||||
private FSClearUnusedBundleFilesOperation _clearUnusedBundleFilesOpA;
|
||||
private FSClearUnusedBundleFilesOperation _clearUnusedBundleFilesOpB;
|
||||
private FSClearUnusedBundleFilesOperation _clearUnusedBundleFilesOpC;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
internal EditorSimulateModeClearUnusedBundleFilesOperation(EditorSimulateModeImpl impl)
|
||||
internal DefaultClearUnusedBundleFilesOperation(IPlayMode impl, IFileSystem fileSystemA, IFileSystem fileSystemB, IFileSystem fileSystemC)
|
||||
{
|
||||
_impl = impl;
|
||||
_fileSystemA = fileSystemA;
|
||||
_fileSystemB = fileSystemB;
|
||||
_fileSystemC = fileSystemC;
|
||||
}
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
_steps = ESteps.ClearUnusedBundleFiles;
|
||||
_steps = ESteps.ClearFileSystemA;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||
return;
|
||||
|
||||
if (_steps == ESteps.ClearUnusedBundleFiles)
|
||||
if (_steps == ESteps.ClearFileSystemA)
|
||||
{
|
||||
if (_clearUnusedBundleFilesOp == null)
|
||||
{
|
||||
_clearUnusedBundleFilesOp = _impl.EditorFileSystem.ClearUnusedBundleFilesAsync(_impl.ActiveManifest);
|
||||
}
|
||||
if (_clearUnusedBundleFilesOpA == null)
|
||||
_clearUnusedBundleFilesOpA = _fileSystemA.ClearUnusedBundleFilesAsync(_impl.ActiveManifest);
|
||||
|
||||
Progress = _clearUnusedBundleFilesOp.Progress;
|
||||
if (_clearUnusedBundleFilesOp.IsDone == false)
|
||||
Progress = _clearUnusedBundleFilesOpA.Progress;
|
||||
if (_clearUnusedBundleFilesOpA.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearUnusedBundleFilesOp.Status == EOperationStatus.Succeed)
|
||||
if (_clearUnusedBundleFilesOpA.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.ClearFileSystemB;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearUnusedBundleFilesOpA.Error;
|
||||
}
|
||||
}
|
||||
|
||||
if (_steps == ESteps.ClearFileSystemB)
|
||||
{
|
||||
if (_fileSystemB == null)
|
||||
{
|
||||
_steps = ESteps.ClearFileSystemC;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_clearUnusedBundleFilesOpB == null)
|
||||
_clearUnusedBundleFilesOpB = _fileSystemB.ClearUnusedBundleFilesAsync(_impl.ActiveManifest);
|
||||
|
||||
Progress = _clearUnusedBundleFilesOpB.Progress;
|
||||
if (_clearUnusedBundleFilesOpB.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearUnusedBundleFilesOpB.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.ClearFileSystemC;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearUnusedBundleFilesOpB.Error;
|
||||
}
|
||||
}
|
||||
|
||||
if (_steps == ESteps.ClearFileSystemC)
|
||||
{
|
||||
if (_fileSystemC == null)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_clearUnusedBundleFilesOpC == null)
|
||||
_clearUnusedBundleFilesOpC = _fileSystemC.ClearUnusedBundleFilesAsync(_impl.ActiveManifest);
|
||||
|
||||
Progress = _clearUnusedBundleFilesOpC.Progress;
|
||||
if (_clearUnusedBundleFilesOpC.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearUnusedBundleFilesOpC.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
@@ -57,229 +121,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearUnusedBundleFilesOp.Error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 离线运行模式
|
||||
/// </summary>
|
||||
internal sealed class OfflinePlayModeClearUnusedBundleFilesOperation : ClearUnusedBundleFilesOperation
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
None,
|
||||
ClearUnusedBundleFiles,
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly OfflinePlayModeImpl _impl;
|
||||
private FSClearUnusedBundleFilesOperation _clearUnusedBundleFilesOp;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
internal OfflinePlayModeClearUnusedBundleFilesOperation(OfflinePlayModeImpl impl)
|
||||
{
|
||||
_impl = impl;
|
||||
}
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
_steps = ESteps.ClearUnusedBundleFiles;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||
return;
|
||||
|
||||
if (_steps == ESteps.ClearUnusedBundleFiles)
|
||||
{
|
||||
if (_clearUnusedBundleFilesOp == null)
|
||||
{
|
||||
_clearUnusedBundleFilesOp = _impl.BuildinFileSystem.ClearUnusedBundleFilesAsync(_impl.ActiveManifest);
|
||||
}
|
||||
|
||||
Progress = _clearUnusedBundleFilesOp.Progress;
|
||||
if (_clearUnusedBundleFilesOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearUnusedBundleFilesOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearUnusedBundleFilesOp.Error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 联机运行模式
|
||||
/// </summary>
|
||||
internal sealed class HostPlayModeClearUnusedBundleFilesOperation : ClearUnusedBundleFilesOperation
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
None,
|
||||
ClearBuildinUnusedBundleFiles,
|
||||
ClearDeliveryUnusedBundleFiles,
|
||||
ClearCacheUnusedBundleFiles,
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly HostPlayModeImpl _impl;
|
||||
private FSClearUnusedBundleFilesOperation _clearBuildinUnusedBundleFilesOp;
|
||||
private FSClearUnusedBundleFilesOperation _clearDeliveryUnusedBundleFilesOp;
|
||||
private FSClearUnusedBundleFilesOperation _clearCacheUnusedBundleFilesOp;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
internal HostPlayModeClearUnusedBundleFilesOperation(HostPlayModeImpl impl)
|
||||
{
|
||||
_impl = impl;
|
||||
}
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
_steps = ESteps.ClearBuildinUnusedBundleFiles;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||
return;
|
||||
|
||||
if (_steps == ESteps.ClearBuildinUnusedBundleFiles)
|
||||
{
|
||||
if (_clearBuildinUnusedBundleFilesOp == null)
|
||||
{
|
||||
_clearBuildinUnusedBundleFilesOp = _impl.BuildinFileSystem.ClearUnusedBundleFilesAsync(_impl.ActiveManifest);
|
||||
}
|
||||
|
||||
Progress = _clearBuildinUnusedBundleFilesOp.Progress;
|
||||
if (_clearBuildinUnusedBundleFilesOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearBuildinUnusedBundleFilesOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.ClearDeliveryUnusedBundleFiles;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearBuildinUnusedBundleFilesOp.Error;
|
||||
}
|
||||
}
|
||||
|
||||
if (_steps == ESteps.ClearDeliveryUnusedBundleFiles)
|
||||
{
|
||||
if (_impl.DeliveryFileSystem == null)
|
||||
{
|
||||
_steps = ESteps.ClearCacheUnusedBundleFiles;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_clearDeliveryUnusedBundleFilesOp == null)
|
||||
{
|
||||
_clearDeliveryUnusedBundleFilesOp = _impl.DeliveryFileSystem.ClearUnusedBundleFilesAsync(_impl.ActiveManifest);
|
||||
}
|
||||
|
||||
Progress = _clearDeliveryUnusedBundleFilesOp.Progress;
|
||||
if (_clearDeliveryUnusedBundleFilesOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearDeliveryUnusedBundleFilesOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.ClearCacheUnusedBundleFiles;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearDeliveryUnusedBundleFilesOp.Error;
|
||||
}
|
||||
}
|
||||
|
||||
if (_steps == ESteps.ClearCacheUnusedBundleFiles)
|
||||
{
|
||||
if (_clearCacheUnusedBundleFilesOp == null)
|
||||
{
|
||||
_clearCacheUnusedBundleFilesOp = _impl.CacheFileSystem.ClearUnusedBundleFilesAsync(_impl.ActiveManifest);
|
||||
}
|
||||
|
||||
Progress = _clearCacheUnusedBundleFilesOp.Progress;
|
||||
if (_clearCacheUnusedBundleFilesOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearCacheUnusedBundleFilesOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearCacheUnusedBundleFilesOp.Error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WebGL运行模式
|
||||
/// </summary>
|
||||
internal sealed class WebPlayModeClearUnusedBundleFilesOperation : ClearUnusedBundleFilesOperation
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
None,
|
||||
ClearUnusedBundleFiles,
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly WebPlayModeImpl _impl;
|
||||
private FSClearUnusedBundleFilesOperation _clearUnusedBundleFilesOp;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
internal WebPlayModeClearUnusedBundleFilesOperation(WebPlayModeImpl impl)
|
||||
{
|
||||
_impl = impl;
|
||||
}
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
_steps = ESteps.ClearUnusedBundleFiles;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||
return;
|
||||
|
||||
if (_steps == ESteps.ClearUnusedBundleFiles)
|
||||
{
|
||||
if (_clearUnusedBundleFilesOp == null)
|
||||
{
|
||||
_clearUnusedBundleFilesOp = _impl.WebFileSystem.ClearUnusedBundleFilesAsync(_impl.ActiveManifest);
|
||||
}
|
||||
|
||||
Progress = _clearUnusedBundleFilesOp.Progress;
|
||||
if (_clearUnusedBundleFilesOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_clearUnusedBundleFilesOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _clearUnusedBundleFilesOp.Error;
|
||||
Error = _clearUnusedBundleFilesOpC.Error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,10 @@ using System.Collections.Generic;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
/// <summary>
|
||||
/// 预下载内容
|
||||
/// 说明:目前只支持联机模式
|
||||
/// </summary>
|
||||
public abstract class PreDownloadContentOperation : AsyncOperationBase
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -13,146 +13,57 @@ namespace YooAsset
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑器下模拟运行
|
||||
/// 通用类
|
||||
/// </summary>
|
||||
internal class EditorSimulateModeRequestPackageVersionOperation : RequestPackageVersionOperation
|
||||
{
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 离线运行模式
|
||||
/// </summary>
|
||||
internal class OfflinePlayModeRequestPackageVersionOperation : RequestPackageVersionOperation
|
||||
{
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 联机运行模式
|
||||
/// </summary>
|
||||
internal class HostPlayModeRequestPackageVersionOperation : RequestPackageVersionOperation
|
||||
internal sealed class DefaultRequestPackageVersionOperation : RequestPackageVersionOperation
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
None,
|
||||
QueryPackageVersion,
|
||||
RequestPackageVersion,
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly HostPlayModeImpl _impl;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly bool _appendTimeTicks;
|
||||
private readonly int _timeout;
|
||||
private FSRequestPackageVersionOperation _queryPackageVersionOp;
|
||||
private FSRequestPackageVersionOperation _requestPackageVersionOp;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
internal HostPlayModeRequestPackageVersionOperation(HostPlayModeImpl impl, bool appendTimeTicks, int timeout)
|
||||
internal DefaultRequestPackageVersionOperation(IFileSystem fileSystem, bool appendTimeTicks, int timeout)
|
||||
{
|
||||
_impl = impl;
|
||||
_fileSystem = fileSystem;
|
||||
_appendTimeTicks = appendTimeTicks;
|
||||
_timeout = timeout;
|
||||
}
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
_steps = ESteps.QueryPackageVersion;
|
||||
_steps = ESteps.RequestPackageVersion;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||
return;
|
||||
|
||||
if (_steps == ESteps.QueryPackageVersion)
|
||||
if (_steps == ESteps.RequestPackageVersion)
|
||||
{
|
||||
if (_queryPackageVersionOp == null)
|
||||
{
|
||||
_queryPackageVersionOp = _impl.CacheFileSystem.RequestPackageVersionAsync(_appendTimeTicks, _timeout);
|
||||
}
|
||||
if (_requestPackageVersionOp == null)
|
||||
_requestPackageVersionOp = _fileSystem.RequestPackageVersionAsync(_appendTimeTicks, _timeout);
|
||||
|
||||
if (_queryPackageVersionOp.IsDone == false)
|
||||
if (_requestPackageVersionOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_queryPackageVersionOp.Status == EOperationStatus.Succeed)
|
||||
if (_requestPackageVersionOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
PackageVersion = _queryPackageVersionOp.PackageVersion;
|
||||
_steps = ESteps.Done;
|
||||
PackageVersion = _requestPackageVersionOp.PackageVersion;
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _queryPackageVersionOp.Error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WebGL运行模式
|
||||
/// </summary>
|
||||
internal class WebPlayModeRequestPackageVersionOperation : RequestPackageVersionOperation
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
None,
|
||||
QueryPackageVersion,
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly WebPlayModeImpl _impl;
|
||||
private readonly bool _appendTimeTicks;
|
||||
private readonly int _timeout;
|
||||
private FSRequestPackageVersionOperation _queryPackageVersionOp;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
internal WebPlayModeRequestPackageVersionOperation(WebPlayModeImpl impl, bool appendTimeTicks, int timeout)
|
||||
{
|
||||
_impl = impl;
|
||||
_appendTimeTicks = appendTimeTicks;
|
||||
_timeout = timeout;
|
||||
}
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
_steps = ESteps.QueryPackageVersion;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||
return;
|
||||
|
||||
if (_steps == ESteps.QueryPackageVersion)
|
||||
{
|
||||
if (_queryPackageVersionOp == null)
|
||||
{
|
||||
_queryPackageVersionOp = _impl.WebFileSystem.RequestPackageVersionAsync(_appendTimeTicks, _timeout);
|
||||
}
|
||||
|
||||
if (_queryPackageVersionOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_queryPackageVersionOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
PackageVersion = _queryPackageVersionOp.PackageVersion;
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _queryPackageVersionOp.Error;
|
||||
Error = _requestPackageVersionOp.Error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,43 +9,9 @@ namespace YooAsset
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑器下模拟运行
|
||||
/// 通用类
|
||||
/// </summary>
|
||||
internal sealed class EditorSimulateModeUpdatePackageManifestOperation : UpdatePackageManifestOperation
|
||||
{
|
||||
public EditorSimulateModeUpdatePackageManifestOperation()
|
||||
{
|
||||
}
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 离线运行模式
|
||||
/// </summary>
|
||||
internal sealed class OfflinePlayModeUpdatePackageManifestOperation : UpdatePackageManifestOperation
|
||||
{
|
||||
public OfflinePlayModeUpdatePackageManifestOperation()
|
||||
{
|
||||
}
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 联机运行模式
|
||||
/// </summary>
|
||||
internal sealed class HostPlayModeUpdatePackageManifestOperation : UpdatePackageManifestOperation
|
||||
internal sealed class DefaultUpdatePackageManifestOperation : UpdatePackageManifestOperation
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
@@ -56,16 +22,18 @@ namespace YooAsset
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly HostPlayModeImpl _impl;
|
||||
private readonly IPlayMode _impl;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly string _packageVersion;
|
||||
private readonly int _timeout;
|
||||
private FSLoadPackageManifestOperation _loadPackageManifestOp;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
|
||||
internal HostPlayModeUpdatePackageManifestOperation(HostPlayModeImpl impl, string packageVersion, int timeout)
|
||||
internal DefaultUpdatePackageManifestOperation(IPlayMode impl, IFileSystem fileSystem, string packageVersion, int timeout)
|
||||
{
|
||||
_impl = impl;
|
||||
_fileSystem = fileSystem;
|
||||
_packageVersion = packageVersion;
|
||||
_timeout = timeout;
|
||||
}
|
||||
@@ -109,95 +77,7 @@ namespace YooAsset
|
||||
if (_steps == ESteps.LoadPackageManifest)
|
||||
{
|
||||
if (_loadPackageManifestOp == null)
|
||||
_loadPackageManifestOp = _impl.CacheFileSystem.LoadPackageManifestAsync(_packageVersion, _timeout);
|
||||
|
||||
if (_loadPackageManifestOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_loadPackageManifestOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
_impl.ActiveManifest = _loadPackageManifestOp.Result;
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _loadPackageManifestOp.Error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WebGL运行模式
|
||||
/// </summary>
|
||||
internal sealed class WebPlayModeUpdatePackageManifestOperation : UpdatePackageManifestOperation
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
None,
|
||||
CheckParams,
|
||||
CheckActiveManifest,
|
||||
LoadRemoteManifest,
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly WebPlayModeImpl _impl;
|
||||
private readonly string _packageVersion;
|
||||
private readonly int _timeout;
|
||||
private FSLoadPackageManifestOperation _loadPackageManifestOp;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
|
||||
internal WebPlayModeUpdatePackageManifestOperation(WebPlayModeImpl impl, string packageVersion, int timeout)
|
||||
{
|
||||
_impl = impl;
|
||||
_packageVersion = packageVersion;
|
||||
_timeout = timeout;
|
||||
}
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
_steps = ESteps.CheckParams;
|
||||
}
|
||||
internal override void InternalOnUpdate()
|
||||
{
|
||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||
return;
|
||||
|
||||
if (_steps == ESteps.CheckParams)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_packageVersion))
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = "Package version is null or empty.";
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.CheckActiveManifest;
|
||||
}
|
||||
}
|
||||
|
||||
if (_steps == ESteps.CheckActiveManifest)
|
||||
{
|
||||
// 检测当前激活的清单对象
|
||||
if (_impl.ActiveManifest != null && _impl.ActiveManifest.PackageVersion == _packageVersion)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.LoadRemoteManifest;
|
||||
}
|
||||
}
|
||||
|
||||
if (_steps == ESteps.LoadRemoteManifest)
|
||||
{
|
||||
if (_loadPackageManifestOp == null)
|
||||
_loadPackageManifestOp = _impl.WebFileSystem.LoadPackageManifestAsync(_packageVersion, _timeout);
|
||||
_loadPackageManifestOp = _fileSystem.LoadPackageManifestAsync(_packageVersion, _timeout);
|
||||
|
||||
if (_loadPackageManifestOp.IsDone == false)
|
||||
return;
|
||||
|
||||
@@ -3,6 +3,13 @@ using System.Reflection;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
public class SimulateBuildResult
|
||||
{
|
||||
public string PackageVersionFilePath;
|
||||
public string PackageManifestFilePath;
|
||||
public string PackageHashFilePath;
|
||||
}
|
||||
|
||||
public static class EditorSimulateModeHelper
|
||||
{
|
||||
private static System.Type _classType;
|
||||
@@ -10,19 +17,18 @@ namespace YooAsset
|
||||
/// <summary>
|
||||
/// 编辑器下模拟构建清单
|
||||
/// </summary>
|
||||
public static string SimulateBuild(string buildPipelineName, string packageName)
|
||||
public static SimulateBuildResult SimulateBuild(string buildPipelineName, string packageName)
|
||||
{
|
||||
if (_classType == null)
|
||||
_classType = Assembly.Load("YooAsset.Editor").GetType("YooAsset.Editor.AssetBundleSimulateBuilder");
|
||||
|
||||
string manifestFilePath = (string)InvokePublicStaticMethod(_classType, "SimulateBuild", buildPipelineName, packageName);
|
||||
return manifestFilePath;
|
||||
return (SimulateBuildResult)InvokePublicStaticMethod(_classType, "SimulateBuild", buildPipelineName, packageName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑器下模拟构建清单
|
||||
/// </summary>
|
||||
public static string SimulateBuild(EDefaultBuildPipeline buildPipeline, string packageName)
|
||||
public static SimulateBuildResult SimulateBuild(EDefaultBuildPipeline buildPipeline, string packageName)
|
||||
{
|
||||
return SimulateBuild(buildPipeline.ToString(), packageName);
|
||||
}
|
||||
|
||||
@@ -36,13 +36,13 @@ namespace YooAsset
|
||||
|
||||
RequestPackageVersionOperation IPlayMode.RequestPackageVersionAsync(bool appendTimeTicks, int timeout)
|
||||
{
|
||||
var operation = new EditorSimulateModeRequestPackageVersionOperation();
|
||||
var operation = new DefaultRequestPackageVersionOperation(EditorFileSystem, appendTimeTicks, timeout);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
UpdatePackageManifestOperation IPlayMode.UpdatePackageManifestAsync(string packageVersion, int timeout)
|
||||
{
|
||||
var operation = new EditorSimulateModeUpdatePackageManifestOperation();
|
||||
var operation = new DefaultUpdatePackageManifestOperation(this, EditorFileSystem, packageVersion, timeout);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
@@ -55,13 +55,13 @@ namespace YooAsset
|
||||
|
||||
ClearAllBundleFilesOperation IPlayMode.ClearAllBundleFilesAsync()
|
||||
{
|
||||
var operation = new EditorSimulateModeClearAllBundleFilesOperation(this);
|
||||
var operation = new DefaultClearAllBundleFilesOperation(this, EditorFileSystem, null, null);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
ClearUnusedBundleFilesOperation IPlayMode.ClearUnusedBundleFilesAsync()
|
||||
{
|
||||
var operation = new EditorSimulateModeClearUnusedBundleFilesOperation(this);
|
||||
var operation = new DefaultClearUnusedBundleFilesOperation(this, EditorFileSystem, null, null);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
|
||||
@@ -44,13 +44,13 @@ namespace YooAsset
|
||||
|
||||
RequestPackageVersionOperation IPlayMode.RequestPackageVersionAsync(bool appendTimeTicks, int timeout)
|
||||
{
|
||||
var operation = new HostPlayModeRequestPackageVersionOperation(this, appendTimeTicks, timeout);
|
||||
var operation = new DefaultRequestPackageVersionOperation(CacheFileSystem, appendTimeTicks, timeout);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
UpdatePackageManifestOperation IPlayMode.UpdatePackageManifestAsync(string packageVersion, int timeout)
|
||||
{
|
||||
var operation = new HostPlayModeUpdatePackageManifestOperation(this, packageVersion, timeout);
|
||||
var operation = new DefaultUpdatePackageManifestOperation(this, CacheFileSystem, packageVersion, timeout);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
@@ -63,13 +63,13 @@ namespace YooAsset
|
||||
|
||||
ClearAllBundleFilesOperation IPlayMode.ClearAllBundleFilesAsync()
|
||||
{
|
||||
var operation = new HostPlayModeClearAllBundleFilesOperation(this);
|
||||
var operation = new DefaultClearAllBundleFilesOperation(this, BuildinFileSystem, DeliveryFileSystem, CacheFileSystem);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
ClearUnusedBundleFilesOperation IPlayMode.ClearUnusedBundleFilesAsync()
|
||||
{
|
||||
var operation = new HostPlayModeClearUnusedBundleFilesOperation(this);
|
||||
var operation = new DefaultClearUnusedBundleFilesOperation(this, BuildinFileSystem, DeliveryFileSystem, CacheFileSystem);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
|
||||
@@ -36,13 +36,13 @@ namespace YooAsset
|
||||
|
||||
RequestPackageVersionOperation IPlayMode.RequestPackageVersionAsync(bool appendTimeTicks, int timeout)
|
||||
{
|
||||
var operation = new OfflinePlayModeRequestPackageVersionOperation();
|
||||
var operation = new DefaultRequestPackageVersionOperation(BuildinFileSystem, appendTimeTicks, timeout);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
UpdatePackageManifestOperation IPlayMode.UpdatePackageManifestAsync(string packageVersion, int timeout)
|
||||
{
|
||||
var operation = new OfflinePlayModeUpdatePackageManifestOperation();
|
||||
var operation = new DefaultUpdatePackageManifestOperation(this, BuildinFileSystem, packageVersion, timeout);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
@@ -55,13 +55,13 @@ namespace YooAsset
|
||||
|
||||
ClearAllBundleFilesOperation IPlayMode.ClearAllBundleFilesAsync()
|
||||
{
|
||||
var operation = new OfflinePlayModeClearAllBundleFilesOperation(this);
|
||||
var operation = new DefaultClearAllBundleFilesOperation(this, BuildinFileSystem, null, null);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
ClearUnusedBundleFilesOperation IPlayMode.ClearUnusedBundleFilesAsync()
|
||||
{
|
||||
var operation = new OfflinePlayModeClearUnusedBundleFilesOperation(this);
|
||||
var operation = new DefaultClearUnusedBundleFilesOperation(this, BuildinFileSystem, null, null);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
|
||||
@@ -36,13 +36,13 @@ namespace YooAsset
|
||||
|
||||
RequestPackageVersionOperation IPlayMode.RequestPackageVersionAsync(bool appendTimeTicks, int timeout)
|
||||
{
|
||||
var operation = new WebPlayModeRequestPackageVersionOperation(this, appendTimeTicks, timeout);
|
||||
var operation = new DefaultRequestPackageVersionOperation(WebFileSystem, appendTimeTicks, timeout);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
UpdatePackageManifestOperation IPlayMode.UpdatePackageManifestAsync(string packageVersion, int timeout)
|
||||
{
|
||||
var operation = new WebPlayModeUpdatePackageManifestOperation(this, packageVersion, timeout);
|
||||
var operation = new DefaultUpdatePackageManifestOperation(this, WebFileSystem, packageVersion, timeout);;
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
@@ -55,13 +55,13 @@ namespace YooAsset
|
||||
|
||||
ClearAllBundleFilesOperation IPlayMode.ClearAllBundleFilesAsync()
|
||||
{
|
||||
var operation = new WebPlayModeClearAllBundleFilesOperation(this);
|
||||
var operation = new DefaultClearAllBundleFilesOperation(this, WebFileSystem, null, null);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
ClearUnusedBundleFilesOperation IPlayMode.ClearUnusedBundleFilesAsync()
|
||||
{
|
||||
var operation = new WebPlayModeClearUnusedBundleFilesOperation(this);
|
||||
var operation = new DefaultClearUnusedBundleFilesOperation(this, WebFileSystem, null, null);
|
||||
OperationSystem.StartOperation(PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user