mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-25 02:00:16 +00:00
Compare commits
19 Commits
d9c911d89b
...
2.3.2-prev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7382afe535 | ||
|
|
af7d4774d6 | ||
|
|
520a8a0623 | ||
|
|
fbd0d8ec40 | ||
|
|
3fea98ce4c | ||
|
|
7c561ce254 | ||
|
|
522ddb5115 | ||
|
|
47f5790507 | ||
|
|
0cdcfe7f52 | ||
|
|
e4d69d869b | ||
|
|
61afb70cb9 | ||
|
|
79580697a1 | ||
|
|
6cb74760b0 | ||
|
|
c758aa81ff | ||
|
|
400c2ccefe | ||
|
|
64e9734bbe | ||
|
|
f6244885be | ||
|
|
82c57c382f | ||
|
|
7eacb46555 |
@@ -2,6 +2,55 @@
|
|||||||
|
|
||||||
All notable changes to this package will be documented in this file.
|
All notable changes to this package will be documented in this file.
|
||||||
|
|
||||||
|
## [2.3.2-preview] - 2025-02-27
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (2.3.1) 修复小游戏平台下载器不生效的问题。
|
||||||
|
- (#480) 修复了Unity工程打包导出时的报错。
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 下载器新增参数:recursiveDownload
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
/// <summary>
|
||||||
|
/// 创建资源下载器,用于下载指定的资源依赖的资源包文件
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="recursiveDownload">下载资源对象所属资源包内所有资源对象依赖的资源包
|
||||||
|
public ResourceDownloaderOperation CreateBundleDownloader()
|
||||||
|
```
|
||||||
|
|
||||||
|
- 新增CustomPlayMode模式
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
/// <summary>
|
||||||
|
/// 自定义运行模式的初始化参数
|
||||||
|
/// </summary>
|
||||||
|
public class CustomPlayModeParameters : InitializeParameters
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 文件系统初始化参数列表
|
||||||
|
/// 注意:列表最后一个元素作为主文件系统!
|
||||||
|
/// </summary>
|
||||||
|
public List<FileSystemParameters> FileSystemParameterList;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## [2.3.1-preview] - 2025-02-25
|
||||||
|
|
||||||
|
**资源加载依赖计算方式还原为了1.5x版本的模式,只加载资源对象实际依赖的资源包,不再以资源对象所在资源包的依赖关系为加载标准**。
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- 优化OperationSystem的更新机制,异步加载的耗时降低了50%。
|
||||||
|
- 优化了Debugger窗口的显示页面,BundleView页面增加资源包的引用列表。
|
||||||
|
- 优化了Reporter窗口的显示页面。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- 修复了怀旧依赖模式下,TAG传染不正确的问题。
|
||||||
|
|
||||||
## [2.3.0-preview] - 2025-02-19
|
## [2.3.0-preview] - 2025-02-19
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
|
|||||||
@@ -51,12 +51,6 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string PackageNote;
|
public string PackageNote;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 怀旧版依赖模式
|
|
||||||
/// 说明:兼容YooAsset1.5.x版本
|
|
||||||
/// </summary>
|
|
||||||
public bool LegacyDependency = false;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 清空构建缓存文件
|
/// 清空构建缓存文件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ namespace YooAsset.Editor
|
|||||||
// 创建新补丁清单
|
// 创建新补丁清单
|
||||||
PackageManifest manifest = new PackageManifest();
|
PackageManifest manifest = new PackageManifest();
|
||||||
manifest.FileVersion = YooAssetSettings.ManifestFileVersion;
|
manifest.FileVersion = YooAssetSettings.ManifestFileVersion;
|
||||||
manifest.LegacyDependency = buildParameters.LegacyDependency;
|
|
||||||
manifest.EnableAddressable = buildMapContext.Command.EnableAddressable;
|
manifest.EnableAddressable = buildMapContext.Command.EnableAddressable;
|
||||||
manifest.LocationToLower = buildMapContext.Command.LocationToLower;
|
manifest.LocationToLower = buildMapContext.Command.LocationToLower;
|
||||||
manifest.IncludeAssetGUID = buildMapContext.Command.IncludeAssetGUID;
|
manifest.IncludeAssetGUID = buildMapContext.Command.IncludeAssetGUID;
|
||||||
@@ -55,13 +54,9 @@ namespace YooAsset.Editor
|
|||||||
if (processBundleTags)
|
if (processBundleTags)
|
||||||
ProcessBundleTags(manifest);
|
ProcessBundleTags(manifest);
|
||||||
|
|
||||||
#region YOOASSET_LEGACY_DEPENDENCY
|
// 4. 处理内置资源包
|
||||||
if (buildParameters.LegacyDependency)
|
if (processBundleDepends)
|
||||||
{
|
ProcessBuiltinBundleDependency(context, manifest);
|
||||||
if (processBundleDepends)
|
|
||||||
ProcessLegacyDependency(context, manifest);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
// 创建补丁清单文本文件
|
// 创建补丁清单文本文件
|
||||||
{
|
{
|
||||||
@@ -73,17 +68,13 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
// 创建补丁清单二进制文件
|
// 创建补丁清单二进制文件
|
||||||
string packageHash;
|
string packageHash;
|
||||||
|
string packagePath;
|
||||||
{
|
{
|
||||||
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(buildParameters.PackageName, buildParameters.PackageVersion);
|
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(buildParameters.PackageName, buildParameters.PackageVersion);
|
||||||
string filePath = $"{packageOutputDirectory}/{fileName}";
|
packagePath = $"{packageOutputDirectory}/{fileName}";
|
||||||
ManifestTools.SerializeToBinary(filePath, manifest);
|
ManifestTools.SerializeToBinary(packagePath, manifest);
|
||||||
packageHash = HashUtility.FileCRC32(filePath);
|
packageHash = HashUtility.FileCRC32(packagePath);
|
||||||
BuildLogger.Log($"Create package manifest file: {filePath}");
|
BuildLogger.Log($"Create package manifest file: {packagePath}");
|
||||||
|
|
||||||
ManifestContext manifestContext = new ManifestContext();
|
|
||||||
byte[] bytesData = FileUtility.ReadAllBytes(filePath);
|
|
||||||
manifestContext.Manifest = ManifestTools.DeserializeFromBinary(bytesData);
|
|
||||||
context.SetContextObject(manifestContext);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建补丁清单哈希文件
|
// 创建补丁清单哈希文件
|
||||||
@@ -101,6 +92,14 @@ namespace YooAsset.Editor
|
|||||||
FileUtility.WriteAllText(filePath, buildParameters.PackageVersion);
|
FileUtility.WriteAllText(filePath, buildParameters.PackageVersion);
|
||||||
BuildLogger.Log($"Create package manifest version file: {filePath}");
|
BuildLogger.Log($"Create package manifest version file: {filePath}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 填充上下文
|
||||||
|
{
|
||||||
|
ManifestContext manifestContext = new ManifestContext();
|
||||||
|
byte[] bytesData = FileUtility.ReadAllBytes(packagePath);
|
||||||
|
manifestContext.Manifest = ManifestTools.DeserializeFromBinary(bytesData);
|
||||||
|
context.SetContextObject(manifestContext);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -192,18 +191,13 @@ namespace YooAsset.Editor
|
|||||||
packageAsset.BundleID = GetCachedBundleIndexID(assetInfo.BundleName);
|
packageAsset.BundleID = GetCachedBundleIndexID(assetInfo.BundleName);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region YOOASSET_LEGACY_DEPENDENCY
|
// 记录资源对象依赖的资源包ID集合
|
||||||
if (manifest.LegacyDependency)
|
// 注意:依赖关系非引擎构建结果里查询!
|
||||||
|
foreach (var packageAsset in manifest.AssetList)
|
||||||
{
|
{
|
||||||
// 记录资源对象依赖的资源包ID集合
|
var mainAssetInfo = packageAsset.TempDataInEditor as BuildAssetInfo;
|
||||||
// 注意:依赖关系非引擎构建结果里查询!
|
packageAsset.DependBundleIDs = GetAssetDependBundleIDs(mainAssetInfo);
|
||||||
foreach (var packageAsset in manifest.AssetList)
|
|
||||||
{
|
|
||||||
var mainAssetInfo = packageAsset.TempDataInEditor as BuildAssetInfo;
|
|
||||||
packageAsset.DependBundleIDs = GetAssetDependBundleIDs(mainAssetInfo);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -215,33 +209,19 @@ namespace YooAsset.Editor
|
|||||||
foreach (var packageBundle in manifest.BundleList)
|
foreach (var packageBundle in manifest.BundleList)
|
||||||
{
|
{
|
||||||
int mainBundleID = GetCachedBundleIndexID(packageBundle.BundleName);
|
int mainBundleID = GetCachedBundleIndexID(packageBundle.BundleName);
|
||||||
string[] depends = GetBundleDepends(context, packageBundle.BundleName);
|
string[] dependNames = GetBundleDepends(context, packageBundle.BundleName);
|
||||||
List<int> dependIDs = new List<int>(depends.Length);
|
List<int> dependIDs = new List<int>(dependNames.Length);
|
||||||
foreach (var dependBundleName in depends)
|
foreach (var dependName in dependNames)
|
||||||
{
|
{
|
||||||
int bundleID = GetCachedBundleIndexID(dependBundleName);
|
int dependBundleID = GetCachedBundleIndexID(dependName);
|
||||||
if (bundleID != mainBundleID)
|
if (dependBundleID != mainBundleID)
|
||||||
dependIDs.Add(bundleID);
|
dependIDs.Add(dependBundleID);
|
||||||
}
|
|
||||||
packageBundle.DependIDs = dependIDs.ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
#region YOOASSET_LEGACY_DEPENDENCY
|
|
||||||
if (manifest.LegacyDependency)
|
|
||||||
{
|
|
||||||
foreach (var packageBundle in manifest.BundleList)
|
|
||||||
{
|
|
||||||
var dependIDs = packageBundle.DependIDs;
|
|
||||||
packageBundle.TempDataInEditor = new DependencyQuery(dependIDs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 记录引用该资源包的资源包ID集合
|
// 排序并填充数据
|
||||||
foreach (var packageBundle in manifest.BundleList)
|
dependIDs.Sort();
|
||||||
{
|
packageBundle.DependBundleIDs = dependIDs.ToArray();
|
||||||
packageBundle.ReferenceBundleIDs = GetBundleReferenceBundleIDs(manifest, packageBundle);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -254,41 +234,17 @@ namespace YooAsset.Editor
|
|||||||
packageBundle.Tags = Array.Empty<string>();
|
packageBundle.Tags = Array.Empty<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// YOOASSET_LEGACY_DEPENDENCY
|
// 将主资源的标签信息传染给其依赖的资源包集合
|
||||||
if (manifest.LegacyDependency)
|
foreach (var packageAsset in manifest.AssetList)
|
||||||
{
|
{
|
||||||
// 将主资源的标签信息传染给其依赖的资源包集合
|
var assetTags = packageAsset.AssetTags;
|
||||||
foreach (var packageAsset in manifest.AssetList)
|
int bundleID = packageAsset.BundleID;
|
||||||
|
CacheBundleTags(bundleID, assetTags);
|
||||||
|
if (packageAsset.DependBundleIDs != null)
|
||||||
{
|
{
|
||||||
var assetTags = packageAsset.AssetTags;
|
foreach (var dependBundleID in packageAsset.DependBundleIDs)
|
||||||
int bundleID = packageAsset.BundleID;
|
|
||||||
CacheBundleTags(bundleID, assetTags);
|
|
||||||
|
|
||||||
if (packageAsset.DependBundleIDs != null)
|
|
||||||
{
|
{
|
||||||
foreach (var dependBundleID in packageAsset.DependBundleIDs)
|
CacheBundleTags(dependBundleID, assetTags);
|
||||||
{
|
|
||||||
CacheBundleTags(dependBundleID, assetTags);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// 将主资源的标签信息传染给其依赖的资源包集合
|
|
||||||
foreach (var packageAsset in manifest.AssetList)
|
|
||||||
{
|
|
||||||
var assetTags = packageAsset.AssetTags;
|
|
||||||
int bundleID = packageAsset.BundleID;
|
|
||||||
CacheBundleTags(bundleID, assetTags);
|
|
||||||
|
|
||||||
var packageBundle = manifest.BundleList[bundleID];
|
|
||||||
if (packageBundle.DependIDs != null)
|
|
||||||
{
|
|
||||||
foreach (var dependBundleID in packageBundle.DependIDs)
|
|
||||||
{
|
|
||||||
CacheBundleTags(dependBundleID, assetTags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -342,26 +298,15 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region YOOASSET_LEGACY_DEPENDENCY
|
#region YOOASSET_LEGACY_DEPENDENCY
|
||||||
private class DependencyQuery
|
private void ProcessBuiltinBundleDependency(BuildContext context, PackageManifest manifest)
|
||||||
{
|
|
||||||
private readonly HashSet<int> _dependIDs;
|
|
||||||
|
|
||||||
public DependencyQuery(int[] dependIDs)
|
|
||||||
{
|
|
||||||
_dependIDs = new HashSet<int>(dependIDs);
|
|
||||||
}
|
|
||||||
public bool Contains(int bundleID)
|
|
||||||
{
|
|
||||||
return _dependIDs.Contains(bundleID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private void ProcessLegacyDependency(BuildContext context, PackageManifest manifest)
|
|
||||||
{
|
{
|
||||||
// 注意:如果是可编程构建管线,需要补充内置资源包
|
// 注意:如果是可编程构建管线,需要补充内置资源包
|
||||||
// 注意:该步骤依赖前面的操作!
|
// 注意:该步骤依赖前面的操作!
|
||||||
var buildResultContext = context.TryGetContextObject<TaskBuilding_SBP.BuildResultContext>();
|
var buildResultContext = context.TryGetContextObject<TaskBuilding_SBP.BuildResultContext>();
|
||||||
if (buildResultContext != null)
|
if (buildResultContext != null)
|
||||||
{
|
{
|
||||||
|
// 注意:初始化资源清单建立引用关系
|
||||||
|
ManifestTools.InitManifest(manifest);
|
||||||
ProcessBuiltinBundleReference(context, manifest, buildResultContext.BuiltinShadersBundleName);
|
ProcessBuiltinBundleReference(context, manifest, buildResultContext.BuiltinShadersBundleName);
|
||||||
ProcessBuiltinBundleReference(context, manifest, buildResultContext.MonoScriptsBundleName);
|
ProcessBuiltinBundleReference(context, manifest, buildResultContext.MonoScriptsBundleName);
|
||||||
}
|
}
|
||||||
@@ -425,26 +370,11 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result.ToArray();
|
|
||||||
}
|
|
||||||
private int[] GetBundleReferenceBundleIDs(PackageManifest manifest, PackageBundle queryBundle)
|
|
||||||
{
|
|
||||||
int queryBundleID = GetCachedBundleIndexID(queryBundle.BundleName);
|
|
||||||
List<int> result = new List<int>();
|
|
||||||
foreach (var packageBundle in manifest.BundleList)
|
|
||||||
{
|
|
||||||
if (packageBundle == queryBundle)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var dependencyQuery = packageBundle.TempDataInEditor as DependencyQuery;
|
// 排序并返回数据
|
||||||
if (dependencyQuery.Contains(queryBundleID))
|
List<int> listResult = new List<int>(result);
|
||||||
{
|
listResult.Sort();
|
||||||
int referenceBundleID = GetCachedBundleIndexID(packageBundle.BundleName);
|
return listResult.ToArray();
|
||||||
if (result.Contains(referenceBundleID) == false)
|
|
||||||
result.Add(referenceBundleID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result.ToArray();
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ namespace YooAsset.Editor
|
|||||||
buildReport.Summary.IgnoreRuleName = buildMapContext.Command.IgnoreRule.GetType().FullName;
|
buildReport.Summary.IgnoreRuleName = buildMapContext.Command.IgnoreRule.GetType().FullName;
|
||||||
|
|
||||||
// 构建参数
|
// 构建参数
|
||||||
buildReport.Summary.LegacyDependency = buildParameters.LegacyDependency;
|
|
||||||
buildReport.Summary.ClearBuildCacheFiles = buildParameters.ClearBuildCacheFiles;
|
buildReport.Summary.ClearBuildCacheFiles = buildParameters.ClearBuildCacheFiles;
|
||||||
buildReport.Summary.UseAssetDependencyDB = buildParameters.UseAssetDependencyDB;
|
buildReport.Summary.UseAssetDependencyDB = buildParameters.UseAssetDependencyDB;
|
||||||
buildReport.Summary.EnableSharePackRule = buildParameters.EnableSharePackRule;
|
buildReport.Summary.EnableSharePackRule = buildParameters.EnableSharePackRule;
|
||||||
@@ -155,8 +154,8 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private List<string> GetBundleDependBundles(PackageManifest manifest, PackageBundle packageBundle)
|
private List<string> GetBundleDependBundles(PackageManifest manifest, PackageBundle packageBundle)
|
||||||
{
|
{
|
||||||
List<string> dependBundles = new List<string>(packageBundle.DependIDs.Length);
|
List<string> dependBundles = new List<string>(packageBundle.DependBundleIDs.Length);
|
||||||
foreach (int index in packageBundle.DependIDs)
|
foreach (int index in packageBundle.DependBundleIDs)
|
||||||
{
|
{
|
||||||
string dependBundleName = manifest.BundleList[index].BundleName;
|
string dependBundleName = manifest.BundleList[index].BundleName;
|
||||||
dependBundles.Add(dependBundleName);
|
dependBundles.Add(dependBundleName);
|
||||||
@@ -170,7 +169,7 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private List<string> GetBundleReferenceBundles(PackageManifest manifest, PackageBundle packageBundle)
|
private List<string> GetBundleReferenceBundles(PackageManifest manifest, PackageBundle packageBundle)
|
||||||
{
|
{
|
||||||
List<string> referenceBundles = new List<string>(packageBundle.ReferenceBundleIDs.Length);
|
List<string> referenceBundles = new List<string>(packageBundle.ReferenceBundleIDs.Count);
|
||||||
foreach (int index in packageBundle.ReferenceBundleIDs)
|
foreach (int index in packageBundle.ReferenceBundleIDs)
|
||||||
{
|
{
|
||||||
string dependBundleName = manifest.BundleList[index].BundleName;
|
string dependBundleName = manifest.BundleList[index].BundleName;
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ namespace YooAsset.Editor
|
|||||||
buildParameters.BuildTarget = BuildTarget;
|
buildParameters.BuildTarget = BuildTarget;
|
||||||
buildParameters.PackageName = PackageName;
|
buildParameters.PackageName = PackageName;
|
||||||
buildParameters.PackageVersion = GetPackageVersion();
|
buildParameters.PackageVersion = GetPackageVersion();
|
||||||
buildParameters.LegacyDependency = false;
|
|
||||||
buildParameters.EnableSharePackRule = true;
|
buildParameters.EnableSharePackRule = true;
|
||||||
buildParameters.VerifyBuildingResult = true;
|
buildParameters.VerifyBuildingResult = true;
|
||||||
buildParameters.FileNameStyle = fileNameStyle;
|
buildParameters.FileNameStyle = fileNameStyle;
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ namespace YooAsset.Editor
|
|||||||
buildParameters.BuildTarget = BuildTarget;
|
buildParameters.BuildTarget = BuildTarget;
|
||||||
buildParameters.PackageName = PackageName;
|
buildParameters.PackageName = PackageName;
|
||||||
buildParameters.PackageVersion = GetPackageVersion();
|
buildParameters.PackageVersion = GetPackageVersion();
|
||||||
buildParameters.LegacyDependency = false;
|
|
||||||
buildParameters.EnableSharePackRule = true;
|
buildParameters.EnableSharePackRule = true;
|
||||||
buildParameters.VerifyBuildingResult = true;
|
buildParameters.VerifyBuildingResult = true;
|
||||||
buildParameters.FileNameStyle = fileNameStyle;
|
buildParameters.FileNameStyle = fileNameStyle;
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ namespace YooAsset.Editor
|
|||||||
packageData.ProviderInfos.Sort();
|
packageData.ProviderInfos.Sort();
|
||||||
foreach (var providerInfo in packageData.ProviderInfos)
|
foreach (var providerInfo in packageData.ProviderInfos)
|
||||||
{
|
{
|
||||||
providerInfo.DependBundleInfos.Sort();
|
providerInfo.DependBundles.Sort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
private class ProviderTableData : DefaultTableData
|
private class ProviderTableData : DefaultTableData
|
||||||
{
|
{
|
||||||
|
public DebugPackageData PackageData;
|
||||||
public DebugProviderInfo ProviderInfo;
|
public DebugProviderInfo ProviderInfo;
|
||||||
}
|
}
|
||||||
private class DependTableData : DefaultTableData
|
private class DependTableData : DefaultTableData
|
||||||
@@ -205,7 +206,7 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
StyleColor textColor;
|
StyleColor textColor;
|
||||||
var providerTableData = data as ProviderTableData;
|
var providerTableData = data as ProviderTableData;
|
||||||
if(providerTableData.ProviderInfo.Status == EOperationStatus.Failed.ToString())
|
if (providerTableData.ProviderInfo.Status == EOperationStatus.Failed.ToString())
|
||||||
textColor = new StyleColor(Color.yellow);
|
textColor = new StyleColor(Color.yellow);
|
||||||
else
|
else
|
||||||
textColor = new StyleColor(Color.white);
|
textColor = new StyleColor(Color.white);
|
||||||
@@ -309,6 +310,7 @@ namespace YooAsset.Editor
|
|||||||
foreach (var providerInfo in packageData.ProviderInfos)
|
foreach (var providerInfo in packageData.ProviderInfos)
|
||||||
{
|
{
|
||||||
var rowData = new ProviderTableData();
|
var rowData = new ProviderTableData();
|
||||||
|
rowData.PackageData = packageData;
|
||||||
rowData.ProviderInfo = providerInfo;
|
rowData.ProviderInfo = providerInfo;
|
||||||
rowData.AddAssetPathCell("PackageName", packageData.PackageName);
|
rowData.AddAssetPathCell("PackageName", packageData.PackageName);
|
||||||
rowData.AddStringValueCell("AssetPath", providerInfo.AssetPath);
|
rowData.AddStringValueCell("AssetPath", providerInfo.AssetPath);
|
||||||
@@ -368,12 +370,14 @@ namespace YooAsset.Editor
|
|||||||
private void OnProviderTableViewSelectionChanged(ITableData data)
|
private void OnProviderTableViewSelectionChanged(ITableData data)
|
||||||
{
|
{
|
||||||
var providerTableData = data as ProviderTableData;
|
var providerTableData = data as ProviderTableData;
|
||||||
|
DebugPackageData packageData = providerTableData.PackageData;
|
||||||
DebugProviderInfo providerInfo = providerTableData.ProviderInfo;
|
DebugProviderInfo providerInfo = providerTableData.ProviderInfo;
|
||||||
|
|
||||||
// 填充依赖数据
|
// 填充依赖数据
|
||||||
var sourceDatas = new List<ITableData>(providerInfo.DependBundleInfos.Count);
|
var sourceDatas = new List<ITableData>(providerInfo.DependBundles.Count);
|
||||||
foreach (var dependBundleInfo in providerInfo.DependBundleInfos)
|
foreach (var bundleName in providerInfo.DependBundles)
|
||||||
{
|
{
|
||||||
|
var dependBundleInfo = packageData.GetBundleInfo(bundleName);
|
||||||
var rowData = new DependTableData();
|
var rowData = new DependTableData();
|
||||||
rowData.BundleInfo = dependBundleInfo;
|
rowData.BundleInfo = dependBundleInfo;
|
||||||
rowData.AddStringValueCell("DependBundles", dependBundleInfo.BundleName);
|
rowData.AddStringValueCell("DependBundles", dependBundleInfo.BundleName);
|
||||||
|
|||||||
@@ -13,19 +13,24 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
private class BundleTableData : DefaultTableData
|
private class BundleTableData : DefaultTableData
|
||||||
{
|
{
|
||||||
public string PackageName;
|
public DebugPackageData PackageData;
|
||||||
public DebugBundleInfo BundleInfo;
|
public DebugBundleInfo BundleInfo;
|
||||||
}
|
}
|
||||||
private class UsingTableData : DefaultTableData
|
private class UsingTableData : DefaultTableData
|
||||||
{
|
{
|
||||||
public DebugProviderInfo ProviderInfo;
|
public DebugProviderInfo ProviderInfo;
|
||||||
}
|
}
|
||||||
|
private class ReferenceTableData : DefaultTableData
|
||||||
|
{
|
||||||
|
public DebugBundleInfo BundleInfo;
|
||||||
|
}
|
||||||
|
|
||||||
private VisualTreeAsset _visualAsset;
|
private VisualTreeAsset _visualAsset;
|
||||||
private TemplateContainer _root;
|
private TemplateContainer _root;
|
||||||
|
|
||||||
private TableView _bundleTableView;
|
private TableView _bundleTableView;
|
||||||
private TableView _usingTableView;
|
private TableView _usingTableView;
|
||||||
|
private TableView _referenceTableView;
|
||||||
|
|
||||||
private DebugReport _debugReport;
|
private DebugReport _debugReport;
|
||||||
private List<ITableData> _sourceDatas;
|
private List<ITableData> _sourceDatas;
|
||||||
@@ -44,20 +49,25 @@ namespace YooAsset.Editor
|
|||||||
_root.style.flexGrow = 1f;
|
_root.style.flexGrow = 1f;
|
||||||
|
|
||||||
// 资源包列表
|
// 资源包列表
|
||||||
_bundleTableView = _root.Q<TableView>("TopTableView");
|
_bundleTableView = _root.Q<TableView>("BundleTableView");
|
||||||
_bundleTableView.SelectionChangedEvent = OnBundleTableViewSelectionChanged;
|
_bundleTableView.SelectionChangedEvent = OnBundleTableViewSelectionChanged;
|
||||||
CreateBundleTableViewColumns();
|
CreateBundleTableViewColumns();
|
||||||
|
|
||||||
// 使用列表
|
// 使用列表
|
||||||
_usingTableView = _root.Q<TableView>("BottomTableView");
|
_usingTableView = _root.Q<TableView>("UsingTableView");
|
||||||
CreateUsingTableViewColumns();
|
CreateUsingTableViewColumns();
|
||||||
|
|
||||||
|
// 引用列表
|
||||||
|
_referenceTableView = _root.Q<TableView>("ReferenceTableView");
|
||||||
|
CreateReferenceTableViewColumns();
|
||||||
|
|
||||||
#if UNITY_2020_3_OR_NEWER
|
#if UNITY_2020_3_OR_NEWER
|
||||||
var topGroup = _root.Q<VisualElement>("TopGroup");
|
var topGroup = _root.Q<VisualElement>("TopGroup");
|
||||||
var bottomGroup = _root.Q<VisualElement>("BottomGroup");
|
var bottomGroup = _root.Q<VisualElement>("BottomGroup");
|
||||||
topGroup.style.minHeight = 100;
|
topGroup.style.minHeight = 100;
|
||||||
bottomGroup.style.minHeight = 100f;
|
bottomGroup.style.minHeight = 100f;
|
||||||
PanelSplitView.SplitVerticalPanel(_root, topGroup, bottomGroup);
|
PanelSplitView.SplitVerticalPanel(_root, topGroup, bottomGroup);
|
||||||
|
PanelSplitView.SplitVerticalPanel(bottomGroup, _usingTableView, _referenceTableView);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
private void CreateBundleTableViewColumns()
|
private void CreateBundleTableViewColumns()
|
||||||
@@ -269,6 +279,79 @@ namespace YooAsset.Editor
|
|||||||
_usingTableView.AddColumn(column);
|
_usingTableView.AddColumn(column);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private void CreateReferenceTableViewColumns()
|
||||||
|
{
|
||||||
|
// BundleName
|
||||||
|
{
|
||||||
|
var columnStyle = new ColumnStyle(600, 500, 1000);
|
||||||
|
columnStyle.Stretchable = true;
|
||||||
|
columnStyle.Searchable = true;
|
||||||
|
columnStyle.Sortable = true;
|
||||||
|
var column = new TableColumn("ReferenceBundle", "Reference Bundle", columnStyle);
|
||||||
|
column.MakeCell = () =>
|
||||||
|
{
|
||||||
|
var label = new Label();
|
||||||
|
label.style.unityTextAlign = TextAnchor.MiddleLeft;
|
||||||
|
return label;
|
||||||
|
};
|
||||||
|
column.BindCell = (VisualElement element, ITableData data, ITableCell cell) =>
|
||||||
|
{
|
||||||
|
var infoLabel = element as Label;
|
||||||
|
infoLabel.text = (string)cell.GetDisplayObject();
|
||||||
|
};
|
||||||
|
_referenceTableView.AddColumn(column);
|
||||||
|
}
|
||||||
|
|
||||||
|
// RefCount
|
||||||
|
{
|
||||||
|
var columnStyle = new ColumnStyle(100);
|
||||||
|
columnStyle.Stretchable = false;
|
||||||
|
columnStyle.Searchable = false;
|
||||||
|
columnStyle.Sortable = true;
|
||||||
|
var column = new TableColumn("RefCount", "Ref Count", columnStyle);
|
||||||
|
column.MakeCell = () =>
|
||||||
|
{
|
||||||
|
var label = new Label();
|
||||||
|
label.style.unityTextAlign = TextAnchor.MiddleLeft;
|
||||||
|
return label;
|
||||||
|
};
|
||||||
|
column.BindCell = (VisualElement element, ITableData data, ITableCell cell) =>
|
||||||
|
{
|
||||||
|
var infoLabel = element as Label;
|
||||||
|
infoLabel.text = (string)cell.GetDisplayObject();
|
||||||
|
};
|
||||||
|
_referenceTableView.AddColumn(column);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Status
|
||||||
|
{
|
||||||
|
var columnStyle = new ColumnStyle(100);
|
||||||
|
columnStyle.Stretchable = false;
|
||||||
|
columnStyle.Searchable = false;
|
||||||
|
columnStyle.Sortable = true;
|
||||||
|
var column = new TableColumn("Status", "Status", columnStyle);
|
||||||
|
column.MakeCell = () =>
|
||||||
|
{
|
||||||
|
var label = new Label();
|
||||||
|
label.style.unityTextAlign = TextAnchor.MiddleLeft;
|
||||||
|
return label;
|
||||||
|
};
|
||||||
|
column.BindCell = (VisualElement element, ITableData data, ITableCell cell) =>
|
||||||
|
{
|
||||||
|
StyleColor textColor;
|
||||||
|
var feferenceTableData = data as ReferenceTableData;
|
||||||
|
if (feferenceTableData.BundleInfo.Status == EOperationStatus.Failed)
|
||||||
|
textColor = new StyleColor(Color.yellow);
|
||||||
|
else
|
||||||
|
textColor = new StyleColor(Color.white);
|
||||||
|
|
||||||
|
var infoLabel = element as Label;
|
||||||
|
infoLabel.text = (string)cell.GetDisplayObject();
|
||||||
|
infoLabel.style.color = textColor;
|
||||||
|
};
|
||||||
|
_referenceTableView.AddColumn(column);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 填充页面数据
|
/// 填充页面数据
|
||||||
@@ -280,30 +363,22 @@ namespace YooAsset.Editor
|
|||||||
// 清空旧数据
|
// 清空旧数据
|
||||||
_bundleTableView.ClearAll(false, true);
|
_bundleTableView.ClearAll(false, true);
|
||||||
_usingTableView.ClearAll(false, true);
|
_usingTableView.ClearAll(false, true);
|
||||||
|
_referenceTableView.ClearAll(false, true);
|
||||||
|
|
||||||
// 填充数据源
|
// 填充数据源
|
||||||
_sourceDatas = new List<ITableData>(1000);
|
_sourceDatas = new List<ITableData>(1000);
|
||||||
foreach (var packageData in debugReport.PackageDatas)
|
foreach (var packageData in debugReport.PackageDatas)
|
||||||
{
|
{
|
||||||
var tempDic = new HashSet<string>();
|
foreach (var bundleInfo in packageData.BundleInfos)
|
||||||
foreach (var providerInfo in packageData.ProviderInfos)
|
|
||||||
{
|
{
|
||||||
foreach (var bundleInfo in providerInfo.DependBundleInfos)
|
var rowData = new BundleTableData();
|
||||||
{
|
rowData.PackageData = packageData;
|
||||||
if (tempDic.Contains(bundleInfo.BundleName) == false)
|
rowData.BundleInfo = bundleInfo;
|
||||||
{
|
rowData.AddAssetPathCell("PackageName", packageData.PackageName);
|
||||||
tempDic.Add(bundleInfo.BundleName);
|
rowData.AddStringValueCell("BundleName", bundleInfo.BundleName);
|
||||||
|
rowData.AddLongValueCell("RefCount", bundleInfo.RefCount);
|
||||||
var rowData = new BundleTableData();
|
rowData.AddStringValueCell("Status", bundleInfo.Status.ToString());
|
||||||
rowData.PackageName = packageData.PackageName;
|
_sourceDatas.Add(rowData);
|
||||||
rowData.BundleInfo = bundleInfo;
|
|
||||||
rowData.AddAssetPathCell("PackageName", packageData.PackageName);
|
|
||||||
rowData.AddStringValueCell("BundleName", bundleInfo.BundleName);
|
|
||||||
rowData.AddLongValueCell("RefCount", bundleInfo.RefCount);
|
|
||||||
rowData.AddStringValueCell("Status", bundleInfo.Status.ToString());
|
|
||||||
_sourceDatas.Add(rowData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_bundleTableView.itemsSource = _sourceDatas;
|
_bundleTableView.itemsSource = _sourceDatas;
|
||||||
@@ -322,6 +397,8 @@ namespace YooAsset.Editor
|
|||||||
_bundleTableView.RebuildView();
|
_bundleTableView.RebuildView();
|
||||||
_usingTableView.ClearAll(false, true);
|
_usingTableView.ClearAll(false, true);
|
||||||
_usingTableView.RebuildView();
|
_usingTableView.RebuildView();
|
||||||
|
_referenceTableView.ClearAll(false, true);
|
||||||
|
_referenceTableView.RebuildView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -355,19 +432,17 @@ namespace YooAsset.Editor
|
|||||||
private void OnBundleTableViewSelectionChanged(ITableData data)
|
private void OnBundleTableViewSelectionChanged(ITableData data)
|
||||||
{
|
{
|
||||||
var bundleTableData = data as BundleTableData;
|
var bundleTableData = data as BundleTableData;
|
||||||
|
var packageData = bundleTableData.PackageData;
|
||||||
|
var selectBundleInfo = bundleTableData.BundleInfo;
|
||||||
|
|
||||||
// 填充依赖数据
|
// 填充UsingTableView
|
||||||
var sourceDatas = new List<ITableData>(1000);
|
|
||||||
foreach (var packageData in _debugReport.PackageDatas)
|
|
||||||
{
|
{
|
||||||
if (packageData.PackageName != bundleTableData.PackageName)
|
var sourceDatas = new List<ITableData>(1000);
|
||||||
continue;
|
|
||||||
|
|
||||||
foreach (var providerInfo in packageData.ProviderInfos)
|
foreach (var providerInfo in packageData.ProviderInfos)
|
||||||
{
|
{
|
||||||
foreach (var bundleInfo in providerInfo.DependBundleInfos)
|
foreach (var dependBundleName in providerInfo.DependBundles)
|
||||||
{
|
{
|
||||||
if (bundleInfo.BundleName == bundleTableData.BundleInfo.BundleName)
|
if (dependBundleName == selectBundleInfo.BundleName)
|
||||||
{
|
{
|
||||||
var rowData = new UsingTableData();
|
var rowData = new UsingTableData();
|
||||||
rowData.ProviderInfo = providerInfo;
|
rowData.ProviderInfo = providerInfo;
|
||||||
@@ -381,9 +456,26 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_usingTableView.itemsSource = sourceDatas;
|
||||||
|
_usingTableView.RebuildView();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填充ReferenceTableView
|
||||||
|
{
|
||||||
|
var sourceDatas = new List<ITableData>(1000);
|
||||||
|
foreach (string referenceBundleName in selectBundleInfo.ReferenceBundles)
|
||||||
|
{
|
||||||
|
var bundleInfo = packageData.GetBundleInfo(referenceBundleName);
|
||||||
|
var rowData = new ReferenceTableData();
|
||||||
|
rowData.BundleInfo = bundleInfo;
|
||||||
|
rowData.AddStringValueCell("BundleName", bundleInfo.BundleName);
|
||||||
|
rowData.AddLongValueCell("RefCount", bundleInfo.RefCount);
|
||||||
|
rowData.AddStringValueCell("Status", bundleInfo.Status.ToString());
|
||||||
|
sourceDatas.Add(rowData);
|
||||||
|
}
|
||||||
|
_referenceTableView.itemsSource = sourceDatas;
|
||||||
|
_referenceTableView.RebuildView();
|
||||||
}
|
}
|
||||||
_usingTableView.itemsSource = sourceDatas;
|
|
||||||
_usingTableView.RebuildView();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
||||||
<ui:VisualElement name="TopGroup" style="flex-grow: 1; border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px; border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); margin-left: 0; margin-right: 0; margin-top: 2px; margin-bottom: 1px; display: flex;">
|
<ui:VisualElement name="TopGroup" style="flex-grow: 1; border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px; border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); margin-left: 0; margin-right: 0; margin-top: 2px; margin-bottom: 1px; display: flex;">
|
||||||
<YooAsset.Editor.TableView name="TopTableView" />
|
<YooAsset.Editor.TableView name="BundleTableView" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
<ui:VisualElement name="BottomGroup" style="height: 200px; border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px; border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); margin-left: 0; margin-right: 0; margin-top: 1px; margin-bottom: 1px; display: flex;">
|
<ui:VisualElement name="BottomGroup" style="height: 400px; border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px; border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); margin-left: 0; margin-right: 0; margin-top: 1px; margin-bottom: 1px; display: flex;">
|
||||||
<YooAsset.Editor.TableView name="BottomTableView" />
|
<YooAsset.Editor.TableView name="UsingTableView" />
|
||||||
|
<YooAsset.Editor.TableView name="ReferenceTableView" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
</ui:UXML>
|
</ui:UXML>
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ namespace YooAsset.Editor
|
|||||||
public string IgnoreRuleName;
|
public string IgnoreRuleName;
|
||||||
|
|
||||||
// 构建参数
|
// 构建参数
|
||||||
public bool LegacyDependency;
|
|
||||||
public bool ClearBuildCacheFiles;
|
public bool ClearBuildCacheFiles;
|
||||||
public bool UseAssetDependencyDB;
|
public bool UseAssetDependencyDB;
|
||||||
public bool EnableSharePackRule;
|
public bool EnableSharePackRule;
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ namespace YooAsset.Editor
|
|||||||
columnStyle.Stretchable = true;
|
columnStyle.Stretchable = true;
|
||||||
columnStyle.Searchable = true;
|
columnStyle.Searchable = true;
|
||||||
columnStyle.Sortable = true;
|
columnStyle.Sortable = true;
|
||||||
|
columnStyle.Counter = true;
|
||||||
var column = new TableColumn("AssetPath", "Asset Path", columnStyle);
|
var column = new TableColumn("AssetPath", "Asset Path", columnStyle);
|
||||||
column.MakeCell = () =>
|
column.MakeCell = () =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ namespace YooAsset.Editor
|
|||||||
columnStyle.Stretchable = true;
|
columnStyle.Stretchable = true;
|
||||||
columnStyle.Searchable = true;
|
columnStyle.Searchable = true;
|
||||||
columnStyle.Sortable = true;
|
columnStyle.Sortable = true;
|
||||||
|
columnStyle.Counter = true;
|
||||||
var column = new TableColumn("BundleName", "Bundle Name", columnStyle);
|
var column = new TableColumn("BundleName", "Bundle Name", columnStyle);
|
||||||
column.MakeCell = () =>
|
column.MakeCell = () =>
|
||||||
{
|
{
|
||||||
@@ -181,6 +182,7 @@ namespace YooAsset.Editor
|
|||||||
columnStyle.Stretchable = true;
|
columnStyle.Stretchable = true;
|
||||||
columnStyle.Searchable = true;
|
columnStyle.Searchable = true;
|
||||||
columnStyle.Sortable = true;
|
columnStyle.Sortable = true;
|
||||||
|
columnStyle.Counter = true;
|
||||||
var column = new TableColumn("IncludeAssets", "Include Assets", columnStyle);
|
var column = new TableColumn("IncludeAssets", "Include Assets", columnStyle);
|
||||||
column.MakeCell = () =>
|
column.MakeCell = () =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ namespace YooAsset.Editor
|
|||||||
BindListViewItem(string.Empty, string.Empty);
|
BindListViewItem(string.Empty, string.Empty);
|
||||||
|
|
||||||
BindListViewHeader("Build Params");
|
BindListViewHeader("Build Params");
|
||||||
BindListViewItem("Legacy Dependency Mode", $"{buildReport.Summary.LegacyDependency}");
|
|
||||||
BindListViewItem("Clear Build Cache Files", $"{buildReport.Summary.ClearBuildCacheFiles}");
|
BindListViewItem("Clear Build Cache Files", $"{buildReport.Summary.ClearBuildCacheFiles}");
|
||||||
BindListViewItem("Use Asset Dependency DB", $"{buildReport.Summary.UseAssetDependencyDB}");
|
BindListViewItem("Use Asset Dependency DB", $"{buildReport.Summary.UseAssetDependencyDB}");
|
||||||
BindListViewItem("Enable Share Pack Rule", $"{buildReport.Summary.EnableSharePackRule}");
|
BindListViewItem("Enable Share Pack Rule", $"{buildReport.Summary.EnableSharePackRule}");
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace YooAsset.Editor
|
|||||||
private List<ITableData> _sortingDatas;
|
private List<ITableData> _sortingDatas;
|
||||||
|
|
||||||
// 排序相关
|
// 排序相关
|
||||||
private string _sortingHeaderElement = string.Empty;
|
private string _sortingHeader;
|
||||||
private bool _descendingSort = true;
|
private bool _descendingSort = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -192,15 +192,37 @@ namespace YooAsset.Editor
|
|||||||
_listView.itemsSource = itemsSource.ToList();
|
_listView.itemsSource = itemsSource.ToList();
|
||||||
_listView.Rebuild();
|
_listView.Rebuild();
|
||||||
|
|
||||||
// 动态设置元素数量
|
// 刷新标题栏
|
||||||
|
RefreshToobar();
|
||||||
|
}
|
||||||
|
private void RefreshToobar()
|
||||||
|
{
|
||||||
|
// 设置为原始标题
|
||||||
|
foreach (var column in _columns)
|
||||||
|
{
|
||||||
|
var toobarButton = _toolbar.Q<ToolbarButton>(column.ElementName);
|
||||||
|
toobarButton.text = column.HeaderTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置元素数量
|
||||||
foreach (var column in _columns)
|
foreach (var column in _columns)
|
||||||
{
|
{
|
||||||
if (column.ColumnStyle.Counter)
|
if (column.ColumnStyle.Counter)
|
||||||
{
|
{
|
||||||
var toobarButton = GetHeaderElement(column.ElementName) as ToolbarButton;
|
var toobarButton = GetHeaderElement(column.ElementName) as ToolbarButton;
|
||||||
toobarButton.text = $"{column.HeaderTitle} ({itemsSource.Count()})";
|
toobarButton.text = $"{toobarButton.text} ({itemsSource.Count()})";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设置升降符号
|
||||||
|
if (string.IsNullOrEmpty(_sortingHeader) == false)
|
||||||
|
{
|
||||||
|
var _toobarButton = _toolbar.Q<ToolbarButton>(_sortingHeader);
|
||||||
|
if (_descendingSort)
|
||||||
|
_toobarButton.text = $"{_toobarButton.text} ↓";
|
||||||
|
else
|
||||||
|
_toobarButton.text = $"{_toobarButton.text} ↑";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -247,9 +269,9 @@ namespace YooAsset.Editor
|
|||||||
if (clickedColumn.ColumnStyle.Sortable == false)
|
if (clickedColumn.ColumnStyle.Sortable == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_sortingHeaderElement != clickedColumn.ElementName)
|
if (_sortingHeader != clickedColumn.ElementName)
|
||||||
{
|
{
|
||||||
_sortingHeaderElement = clickedColumn.ElementName;
|
_sortingHeader = clickedColumn.ElementName;
|
||||||
_descendingSort = false;
|
_descendingSort = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -257,17 +279,6 @@ namespace YooAsset.Editor
|
|||||||
_descendingSort = !_descendingSort;
|
_descendingSort = !_descendingSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 升降符号
|
|
||||||
foreach (var column in _columns)
|
|
||||||
{
|
|
||||||
var button = _toolbar.Q<ToolbarButton>(column.ElementName);
|
|
||||||
button.text = column.HeaderTitle;
|
|
||||||
}
|
|
||||||
if (_descendingSort)
|
|
||||||
toolbarBtn.text = $"{clickedColumn.HeaderTitle} ↓";
|
|
||||||
else
|
|
||||||
toolbarBtn.text = $"{clickedColumn.HeaderTitle} ↑";
|
|
||||||
|
|
||||||
// 升降排序
|
// 升降排序
|
||||||
if (_descendingSort)
|
if (_descendingSort)
|
||||||
_sortingDatas = _itemsSource.OrderByDescending(tableData => tableData.Cells[clickedColumn.ColumnIndex]).ToList();
|
_sortingDatas = _itemsSource.OrderByDescending(tableData => tableData.Cells[clickedColumn.ColumnIndex]).ToList();
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ namespace YooAsset
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public EOperationStatus Status;
|
public EOperationStatus Status;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 谁引用了该资源包
|
||||||
|
/// </summary>
|
||||||
|
public List<string> ReferenceBundles;
|
||||||
|
|
||||||
public int CompareTo(DebugBundleInfo other)
|
public int CompareTo(DebugBundleInfo other)
|
||||||
{
|
{
|
||||||
return Compare(this, other);
|
return Compare(this, other);
|
||||||
|
|||||||
@@ -17,5 +17,44 @@ namespace YooAsset
|
|||||||
/// 调试数据列表
|
/// 调试数据列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<DebugProviderInfo> ProviderInfos = new List<DebugProviderInfo>(1000);
|
public List<DebugProviderInfo> ProviderInfos = new List<DebugProviderInfo>(1000);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 调试数据列表
|
||||||
|
/// </summary>
|
||||||
|
public List<DebugBundleInfo> BundleInfos = new List<DebugBundleInfo>(1000);
|
||||||
|
|
||||||
|
|
||||||
|
[NonSerialized]
|
||||||
|
public Dictionary<string, DebugBundleInfo> BundleInfoDic = new Dictionary<string, DebugBundleInfo>();
|
||||||
|
private bool _isParse = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取调试资源包信息类
|
||||||
|
/// </summary>
|
||||||
|
public DebugBundleInfo GetBundleInfo(string bundleName)
|
||||||
|
{
|
||||||
|
// 解析数据
|
||||||
|
if (_isParse == false)
|
||||||
|
{
|
||||||
|
_isParse = true;
|
||||||
|
foreach (var bundleInfo in BundleInfos)
|
||||||
|
{
|
||||||
|
if (BundleInfoDic.ContainsKey(bundleInfo.BundleName) == false)
|
||||||
|
{
|
||||||
|
BundleInfoDic.Add(bundleInfo.BundleName, bundleInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BundleInfoDic.TryGetValue(bundleName, out DebugBundleInfo value))
|
||||||
|
{
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UnityEngine.Debug.LogError($"Can not found {nameof(DebugBundleInfo)} : {bundleName}");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@ namespace YooAsset
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 依赖的资源包列表
|
/// 依赖的资源包列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<DebugBundleInfo> DependBundleInfos;
|
public List<string> DependBundles;
|
||||||
|
|
||||||
public int CompareTo(DebugProviderInfo other)
|
public int CompareTo(DebugProviderInfo other)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ namespace YooAsset
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public List<DebugPackageData> PackageDatas = new List<DebugPackageData>(10);
|
public List<DebugPackageData> PackageDatas = new List<DebugPackageData>(10);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 序列化
|
/// 序列化
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ namespace YooAsset
|
|||||||
internal UnityWebDataRequestOperation(string url, int timeout = 60) : base(url, timeout)
|
internal UnityWebDataRequestOperation(string url, int timeout = 60) : base(url, timeout)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.CreateRequest;
|
_steps = ESteps.CreateRequest;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -59,7 +59,7 @@ namespace YooAsset
|
|||||||
DisposeRequest();
|
DisposeRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
internal override void InternalOnAbort()
|
internal override void InternalAbort()
|
||||||
{
|
{
|
||||||
_steps = ESteps.Done;
|
_steps = ESteps.Done;
|
||||||
DisposeRequest();
|
DisposeRequest();
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSavePath = fileSavePath;
|
_fileSavePath = fileSavePath;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.CreateRequest;
|
_steps = ESteps.CreateRequest;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -54,7 +54,7 @@ namespace YooAsset
|
|||||||
DisposeRequest();
|
DisposeRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
internal override void InternalOnAbort()
|
internal override void InternalAbort()
|
||||||
{
|
{
|
||||||
_steps = ESteps.Done;
|
_steps = ESteps.Done;
|
||||||
DisposeRequest();
|
DisposeRequest();
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ namespace YooAsset
|
|||||||
internal UnityWebTextRequestOperation(string url, int timeout = 60) : base(url, timeout)
|
internal UnityWebTextRequestOperation(string url, int timeout = 60) : base(url, timeout)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.CreateRequest;
|
_steps = ESteps.CreateRequest;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -59,7 +59,7 @@ namespace YooAsset
|
|||||||
DisposeRequest();
|
DisposeRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
internal override void InternalOnAbort()
|
internal override void InternalAbort()
|
||||||
{
|
{
|
||||||
_steps = ESteps.Done;
|
_steps = ESteps.Done;
|
||||||
DisposeRequest();
|
DisposeRequest();
|
||||||
|
|||||||
@@ -48,25 +48,21 @@ namespace YooAsset
|
|||||||
public override FSLoadAssetOperation LoadAssetAsync(AssetInfo assetInfo)
|
public override FSLoadAssetOperation LoadAssetAsync(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
var operation = new AssetBundleLoadAssetOperation(_packageBundle, _assetBundle, assetInfo);
|
var operation = new AssetBundleLoadAssetOperation(_packageBundle, _assetBundle, assetInfo);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public override FSLoadAllAssetsOperation LoadAllAssetsAsync(AssetInfo assetInfo)
|
public override FSLoadAllAssetsOperation LoadAllAssetsAsync(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
var operation = new AssetBundleLoadAllAssetsOperation(_packageBundle, _assetBundle, assetInfo);
|
var operation = new AssetBundleLoadAllAssetsOperation(_packageBundle, _assetBundle, assetInfo);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public override FSLoadSubAssetsOperation LoadSubAssetsAsync(AssetInfo assetInfo)
|
public override FSLoadSubAssetsOperation LoadSubAssetsAsync(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
var operation = new AssetBundleLoadSubAssetsOperation(_packageBundle, _assetBundle, assetInfo);
|
var operation = new AssetBundleLoadSubAssetsOperation(_packageBundle, _assetBundle, assetInfo);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public override FSLoadSceneOperation LoadSceneOperation(AssetInfo assetInfo, LoadSceneParameters loadParams, bool suspendLoad)
|
public override FSLoadSceneOperation LoadSceneOperation(AssetInfo assetInfo, LoadSceneParameters loadParams, bool suspendLoad)
|
||||||
{
|
{
|
||||||
var operation = new AssetBundleLoadSceneOperation(assetInfo, loadParams, suspendLoad);
|
var operation = new AssetBundleLoadSceneOperation(assetInfo, loadParams, suspendLoad);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ namespace YooAsset
|
|||||||
_assetBundle = assetBundle;
|
_assetBundle = assetBundle;
|
||||||
_assetInfo = assetInfo;
|
_assetInfo = assetInfo;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.CheckBundle;
|
_steps = ESteps.CheckBundle;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ namespace YooAsset
|
|||||||
_assetBundle = assetBundle;
|
_assetBundle = assetBundle;
|
||||||
_assetInfo = assetInfo;
|
_assetInfo = assetInfo;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.CheckBundle;
|
_steps = ESteps.CheckBundle;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ namespace YooAsset
|
|||||||
_loadParams = loadParams;
|
_loadParams = loadParams;
|
||||||
_suspendLoad = suspendLoad;
|
_suspendLoad = suspendLoad;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadScene;
|
_steps = ESteps.LoadScene;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -107,7 +107,7 @@ namespace YooAsset
|
|||||||
internal override void InternalWaitForAsyncComplete()
|
internal override void InternalWaitForAsyncComplete()
|
||||||
{
|
{
|
||||||
//TODO 场景加载不支持异步转同步,为了支持同步加载方法需要实现该方法!
|
//TODO 场景加载不支持异步转同步,为了支持同步加载方法需要实现该方法!
|
||||||
InternalOnUpdate();
|
InternalUpdate();
|
||||||
}
|
}
|
||||||
public override void UnSuspendLoad()
|
public override void UnSuspendLoad()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ namespace YooAsset
|
|||||||
_assetBundle = assetBundle;
|
_assetBundle = assetBundle;
|
||||||
_assetInfo = assetInfo;
|
_assetInfo = assetInfo;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.CheckBundle;
|
_steps = ESteps.CheckBundle;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
internal class RawBundleLoadAllAssetsOperation : FSLoadAllAssetsOperation
|
internal class RawBundleLoadAllAssetsOperation : FSLoadAllAssetsOperation
|
||||||
{
|
{
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
Error = $"{nameof(RawBundleLoadAllAssetsOperation)} not support load all assets !";
|
Error = $"{nameof(RawBundleLoadAllAssetsOperation)} not support load all assets !";
|
||||||
Status = EOperationStatus.Failed;
|
Status = EOperationStatus.Failed;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
internal class RawBundleLoadAssetOperation : FSLoadAssetOperation
|
internal class RawBundleLoadAssetOperation : FSLoadAssetOperation
|
||||||
{
|
{
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
Error = $"{nameof(RawBundleLoadAssetOperation)} not support load asset !";
|
Error = $"{nameof(RawBundleLoadAssetOperation)} not support load asset !";
|
||||||
Status = EOperationStatus.Failed;
|
Status = EOperationStatus.Failed;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
internal class RawBundleLoadSceneOperation : FSLoadSceneOperation
|
internal class RawBundleLoadSceneOperation : FSLoadSceneOperation
|
||||||
{
|
{
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
Error = $"{nameof(RawBundleLoadSceneOperation)} not support load scene !";
|
Error = $"{nameof(RawBundleLoadSceneOperation)} not support load scene !";
|
||||||
Status = EOperationStatus.Failed;
|
Status = EOperationStatus.Failed;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
public override void UnSuspendLoad()
|
public override void UnSuspendLoad()
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
internal class RawBundleLoadSubAssetsOperation : FSLoadSubAssetsOperation
|
internal class RawBundleLoadSubAssetsOperation : FSLoadSubAssetsOperation
|
||||||
{
|
{
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
Error = $"{nameof(RawBundleLoadSubAssetsOperation)} not support load sub assets !";
|
Error = $"{nameof(RawBundleLoadSubAssetsOperation)} not support load sub assets !";
|
||||||
Status = EOperationStatus.Failed;
|
Status = EOperationStatus.Failed;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,25 +32,21 @@ namespace YooAsset
|
|||||||
public override FSLoadAssetOperation LoadAssetAsync(AssetInfo assetInfo)
|
public override FSLoadAssetOperation LoadAssetAsync(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
var operation = new RawBundleLoadAssetOperation();
|
var operation = new RawBundleLoadAssetOperation();
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public override FSLoadAllAssetsOperation LoadAllAssetsAsync(AssetInfo assetInfo)
|
public override FSLoadAllAssetsOperation LoadAllAssetsAsync(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
var operation = new RawBundleLoadAllAssetsOperation();
|
var operation = new RawBundleLoadAllAssetsOperation();
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public override FSLoadSubAssetsOperation LoadSubAssetsAsync(AssetInfo assetInfo)
|
public override FSLoadSubAssetsOperation LoadSubAssetsAsync(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
var operation = new RawBundleLoadSubAssetsOperation();
|
var operation = new RawBundleLoadSubAssetsOperation();
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public override FSLoadSceneOperation LoadSceneOperation(AssetInfo assetInfo, LoadSceneParameters loadParams, bool suspendLoad)
|
public override FSLoadSceneOperation LoadSceneOperation(AssetInfo assetInfo, LoadSceneParameters loadParams, bool suspendLoad)
|
||||||
{
|
{
|
||||||
var operation = new RawBundleLoadSceneOperation();
|
var operation = new RawBundleLoadSceneOperation();
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace YooAsset
|
|||||||
_packageBundle = packageBundle;
|
_packageBundle = packageBundle;
|
||||||
_assetInfo = assetInfo;
|
_assetInfo = assetInfo;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
_steps = ESteps.CheckBundle;
|
_steps = ESteps.CheckBundle;
|
||||||
@@ -32,7 +32,7 @@ namespace YooAsset
|
|||||||
Status = EOperationStatus.Failed;
|
Status = EOperationStatus.Failed;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace YooAsset
|
|||||||
_packageBundle = packageBundle;
|
_packageBundle = packageBundle;
|
||||||
_assetInfo = assetInfo;
|
_assetInfo = assetInfo;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
_steps = ESteps.CheckBundle;
|
_steps = ESteps.CheckBundle;
|
||||||
@@ -31,7 +31,7 @@ namespace YooAsset
|
|||||||
Status = EOperationStatus.Failed;
|
Status = EOperationStatus.Failed;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace YooAsset
|
|||||||
_loadParams = loadParams;
|
_loadParams = loadParams;
|
||||||
_suspendLoad = suspendLoad;
|
_suspendLoad = suspendLoad;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
_steps = ESteps.LoadScene;
|
_steps = ESteps.LoadScene;
|
||||||
@@ -35,7 +35,7 @@ namespace YooAsset
|
|||||||
Status = EOperationStatus.Failed;
|
Status = EOperationStatus.Failed;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
@@ -113,7 +113,7 @@ namespace YooAsset
|
|||||||
internal override void InternalWaitForAsyncComplete()
|
internal override void InternalWaitForAsyncComplete()
|
||||||
{
|
{
|
||||||
//TODO 场景加载不支持异步转同步,为了支持同步加载方法需要实现该方法!
|
//TODO 场景加载不支持异步转同步,为了支持同步加载方法需要实现该方法!
|
||||||
InternalOnUpdate();
|
InternalUpdate();
|
||||||
}
|
}
|
||||||
public override void UnSuspendLoad()
|
public override void UnSuspendLoad()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace YooAsset
|
|||||||
_packageBundle = packageBundle;
|
_packageBundle = packageBundle;
|
||||||
_assetInfo = assetInfo;
|
_assetInfo = assetInfo;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
_steps = ESteps.CheckBundle;
|
_steps = ESteps.CheckBundle;
|
||||||
@@ -32,7 +32,7 @@ namespace YooAsset
|
|||||||
Status = EOperationStatus.Failed;
|
Status = EOperationStatus.Failed;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
|
|||||||
@@ -32,25 +32,21 @@ namespace YooAsset
|
|||||||
public override FSLoadAssetOperation LoadAssetAsync(AssetInfo assetInfo)
|
public override FSLoadAssetOperation LoadAssetAsync(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
var operation = new VirtualBundleLoadAssetOperation(_packageBundle, assetInfo);
|
var operation = new VirtualBundleLoadAssetOperation(_packageBundle, assetInfo);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public override FSLoadAllAssetsOperation LoadAllAssetsAsync(AssetInfo assetInfo)
|
public override FSLoadAllAssetsOperation LoadAllAssetsAsync(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
var operation = new VirtualBundleLoadAllAssetsOperation(_packageBundle, assetInfo);
|
var operation = new VirtualBundleLoadAllAssetsOperation(_packageBundle, assetInfo);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public override FSLoadSubAssetsOperation LoadSubAssetsAsync(AssetInfo assetInfo)
|
public override FSLoadSubAssetsOperation LoadSubAssetsAsync(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
var operation = new VirtualBundleLoadSubAssetsOperation(_packageBundle, assetInfo);
|
var operation = new VirtualBundleLoadSubAssetsOperation(_packageBundle, assetInfo);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public override FSLoadSceneOperation LoadSceneOperation(AssetInfo assetInfo, LoadSceneParameters loadParams, bool suspendLoad)
|
public override FSLoadSceneOperation LoadSceneOperation(AssetInfo assetInfo, LoadSceneParameters loadParams, bool suspendLoad)
|
||||||
{
|
{
|
||||||
var operation = new VirtualBundleLoadSceneOperation(assetInfo, loadParams, suspendLoad);
|
var operation = new VirtualBundleLoadSceneOperation(assetInfo, loadParams, suspendLoad);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,19 +92,16 @@ namespace YooAsset
|
|||||||
public virtual FSInitializeFileSystemOperation InitializeFileSystemAsync()
|
public virtual FSInitializeFileSystemOperation InitializeFileSystemAsync()
|
||||||
{
|
{
|
||||||
var operation = new DBFSInitializeOperation(this);
|
var operation = new DBFSInitializeOperation(this);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSLoadPackageManifestOperation LoadPackageManifestAsync(string packageVersion, int timeout)
|
public virtual FSLoadPackageManifestOperation LoadPackageManifestAsync(string packageVersion, int timeout)
|
||||||
{
|
{
|
||||||
var operation = new DBFSLoadPackageManifestOperation(this, packageVersion);
|
var operation = new DBFSLoadPackageManifestOperation(this, packageVersion);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSRequestPackageVersionOperation RequestPackageVersionAsync(bool appendTimeTicks, int timeout)
|
public virtual FSRequestPackageVersionOperation RequestPackageVersionAsync(bool appendTimeTicks, int timeout)
|
||||||
{
|
{
|
||||||
var operation = new DBFSRequestPackageVersionOperation(this);
|
var operation = new DBFSRequestPackageVersionOperation(this);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSClearCacheFilesOperation ClearCacheFilesAsync(PackageManifest manifest, string clearMode, object clearParam)
|
public virtual FSClearCacheFilesOperation ClearCacheFilesAsync(PackageManifest manifest, string clearMode, object clearParam)
|
||||||
@@ -127,20 +124,17 @@ namespace YooAsset
|
|||||||
if (bundle.BundleType == (int)EBuildBundleType.AssetBundle)
|
if (bundle.BundleType == (int)EBuildBundleType.AssetBundle)
|
||||||
{
|
{
|
||||||
var operation = new DBFSLoadAssetBundleOperation(this, bundle);
|
var operation = new DBFSLoadAssetBundleOperation(this, bundle);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (bundle.BundleType == (int)EBuildBundleType.RawBundle)
|
else if (bundle.BundleType == (int)EBuildBundleType.RawBundle)
|
||||||
{
|
{
|
||||||
var operation = new DBFSLoadRawBundleOperation(this, bundle);
|
var operation = new DBFSLoadRawBundleOperation(this, bundle);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string error = $"{nameof(DefaultBuildinFileSystem)} not support load bundle type : {bundle.BundleType}";
|
string error = $"{nameof(DefaultBuildinFileSystem)} not support load bundle type : {bundle.BundleType}";
|
||||||
var operation = new FSLoadBundleCompleteOperation(error);
|
var operation = new FSLoadBundleCompleteOperation(error);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -194,9 +188,8 @@ namespace YooAsset
|
|||||||
_unpackFileSystem.SetParameter(FileSystemParametersDefine.DECRYPTION_SERVICES, DecryptionServices);
|
_unpackFileSystem.SetParameter(FileSystemParametersDefine.DECRYPTION_SERVICES, DecryptionServices);
|
||||||
_unpackFileSystem.OnCreate(packageName, null);
|
_unpackFileSystem.OnCreate(packageName, null);
|
||||||
}
|
}
|
||||||
public virtual void OnUpdate()
|
public virtual void OnDestroy()
|
||||||
{
|
{
|
||||||
_unpackFileSystem.OnUpdate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool Belong(PackageBundle bundle)
|
public virtual bool Belong(PackageBundle bundle)
|
||||||
@@ -346,10 +339,13 @@ namespace YooAsset
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if UNITY_ANDROID
|
#if UNITY_ANDROID
|
||||||
if (bundle.BundleType == (int)EBuildBundleType.RawBundle || bundle.Encrypted)
|
if (bundle.Encrypted)
|
||||||
return true;
|
return true;
|
||||||
else
|
|
||||||
return false;
|
if (bundle.BundleType == (int)EBuildBundleType.RawBundle)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -18,9 +18,8 @@ namespace YooAsset
|
|||||||
YooLogger.Log("Begin to create catalog file !");
|
YooLogger.Log("Begin to create catalog file !");
|
||||||
|
|
||||||
string savePath = YooAssetSettingsData.GetYooResourcesFullPath();
|
string savePath = YooAssetSettingsData.GetYooResourcesFullPath();
|
||||||
DirectoryInfo saveDirectory = new DirectoryInfo(savePath);
|
if (UnityEditor.AssetDatabase.DeleteAsset(savePath))
|
||||||
if (saveDirectory.Exists)
|
UnityEditor.AssetDatabase.Refresh();
|
||||||
saveDirectory.Delete(true);
|
|
||||||
|
|
||||||
string rootPath = YooAssetSettingsData.GetYooDefaultBuildinRoot();
|
string rootPath = YooAssetSettingsData.GetYooDefaultBuildinRoot();
|
||||||
DirectoryInfo rootDirectory = new DirectoryInfo(rootPath);
|
DirectoryInfo rootDirectory = new DirectoryInfo(rootPath);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
#if UNITY_WEBGL
|
#if UNITY_WEBGL
|
||||||
_steps = ESteps.Done;
|
_steps = ESteps.Done;
|
||||||
@@ -37,7 +37,7 @@ namespace YooAsset
|
|||||||
_steps = ESteps.InitUnpackFileSystem;
|
_steps = ESteps.InitUnpackFileSystem;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -47,9 +47,11 @@ namespace YooAsset
|
|||||||
if (_copyBuildinPackageManifestOp == null)
|
if (_copyBuildinPackageManifestOp == null)
|
||||||
{
|
{
|
||||||
_copyBuildinPackageManifestOp = new CopyBuildinPackageManifestOperation(_fileSystem);
|
_copyBuildinPackageManifestOp = new CopyBuildinPackageManifestOperation(_fileSystem);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _copyBuildinPackageManifestOp);
|
_copyBuildinPackageManifestOp.StartOperation();
|
||||||
|
AddChildOperation(_copyBuildinPackageManifestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_copyBuildinPackageManifestOp.UpdateOperation();
|
||||||
if (_copyBuildinPackageManifestOp.IsDone == false)
|
if (_copyBuildinPackageManifestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -68,8 +70,13 @@ namespace YooAsset
|
|||||||
if (_steps == ESteps.InitUnpackFileSystem)
|
if (_steps == ESteps.InitUnpackFileSystem)
|
||||||
{
|
{
|
||||||
if (_initUnpackFIleSystemOp == null)
|
if (_initUnpackFIleSystemOp == null)
|
||||||
|
{
|
||||||
_initUnpackFIleSystemOp = _fileSystem.InitializeUpackFileSystem();
|
_initUnpackFIleSystemOp = _fileSystem.InitializeUpackFileSystem();
|
||||||
|
_initUnpackFIleSystemOp.StartOperation();
|
||||||
|
AddChildOperation(_initUnpackFIleSystemOp);
|
||||||
|
}
|
||||||
|
|
||||||
|
_initUnpackFIleSystemOp.UpdateOperation();
|
||||||
Progress = _initUnpackFIleSystemOp.Progress;
|
Progress = _initUnpackFIleSystemOp.Progress;
|
||||||
if (_initUnpackFIleSystemOp.IsDone == false)
|
if (_initUnpackFIleSystemOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
@@ -113,9 +120,11 @@ namespace YooAsset
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
_loadCatalogFileOp = new LoadBuildinCatalogFileOperation(_fileSystem);
|
_loadCatalogFileOp = new LoadBuildinCatalogFileOperation(_fileSystem);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _loadCatalogFileOp);
|
_loadCatalogFileOp.StartOperation();
|
||||||
|
AddChildOperation(_loadCatalogFileOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_loadCatalogFileOp.UpdateOperation();
|
||||||
if (_loadCatalogFileOp.IsDone == false)
|
if (_loadCatalogFileOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_bundle = bundle;
|
_bundle = bundle;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
DownloadProgress = 1f;
|
DownloadProgress = 1f;
|
||||||
DownloadedBytes = _bundle.FileSize;
|
DownloadedBytes = _bundle.FileSize;
|
||||||
_steps = ESteps.LoadAssetBundle;
|
_steps = ESteps.LoadAssetBundle;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -139,9 +139,6 @@ namespace YooAsset
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override void AbortDownloadOperation()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -166,13 +163,13 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_bundle = bundle;
|
_bundle = bundle;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
DownloadProgress = 1f;
|
DownloadProgress = 1f;
|
||||||
DownloadedBytes = _bundle.FileSize;
|
DownloadedBytes = _bundle.FileSize;
|
||||||
_steps = ESteps.LoadBuildinRawBundle;
|
_steps = ESteps.LoadBuildinRawBundle;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -206,8 +203,5 @@ namespace YooAsset
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override void AbortDownloadOperation()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,11 +23,11 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.RequestBuildinPackageHash;
|
_steps = ESteps.RequestBuildinPackageHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -37,9 +37,11 @@ namespace YooAsset
|
|||||||
if (_requestBuildinPackageHashOp == null)
|
if (_requestBuildinPackageHashOp == null)
|
||||||
{
|
{
|
||||||
_requestBuildinPackageHashOp = new RequestBuildinPackageHashOperation(_fileSystem, _packageVersion);
|
_requestBuildinPackageHashOp = new RequestBuildinPackageHashOperation(_fileSystem, _packageVersion);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _requestBuildinPackageHashOp);
|
_requestBuildinPackageHashOp.StartOperation();
|
||||||
|
AddChildOperation(_requestBuildinPackageHashOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_requestBuildinPackageHashOp.UpdateOperation();
|
||||||
if (_requestBuildinPackageHashOp.IsDone == false)
|
if (_requestBuildinPackageHashOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -61,9 +63,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
string packageHash = _requestBuildinPackageHashOp.PackageHash;
|
string packageHash = _requestBuildinPackageHashOp.PackageHash;
|
||||||
_loadBuildinPackageManifestOp = new LoadBuildinPackageManifestOperation(_fileSystem, _packageVersion, packageHash);
|
_loadBuildinPackageManifestOp = new LoadBuildinPackageManifestOperation(_fileSystem, _packageVersion, packageHash);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _loadBuildinPackageManifestOp);
|
_loadBuildinPackageManifestOp.StartOperation();
|
||||||
|
AddChildOperation(_loadBuildinPackageManifestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_loadBuildinPackageManifestOp.UpdateOperation();
|
||||||
if (_loadBuildinPackageManifestOp.IsDone == false)
|
if (_loadBuildinPackageManifestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.RequestPackageVersion;
|
_steps = ESteps.RequestPackageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -33,9 +33,11 @@ namespace YooAsset
|
|||||||
if (_requestBuildinPackageVersionOp == null)
|
if (_requestBuildinPackageVersionOp == null)
|
||||||
{
|
{
|
||||||
_requestBuildinPackageVersionOp = new RequestBuildinPackageVersionOperation(_fileSystem);
|
_requestBuildinPackageVersionOp = new RequestBuildinPackageVersionOperation(_fileSystem);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _requestBuildinPackageVersionOp);
|
_requestBuildinPackageVersionOp.StartOperation();
|
||||||
|
AddChildOperation(_requestBuildinPackageVersionOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_requestBuildinPackageVersionOp.UpdateOperation();
|
||||||
if (_requestBuildinPackageVersionOp.IsDone == false)
|
if (_requestBuildinPackageVersionOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.RequestPackageVersion;
|
_steps = ESteps.RequestPackageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -43,9 +43,11 @@ namespace YooAsset
|
|||||||
if (_requestBuildinPackageVersionOp == null)
|
if (_requestBuildinPackageVersionOp == null)
|
||||||
{
|
{
|
||||||
_requestBuildinPackageVersionOp = new RequestBuildinPackageVersionOperation(_fileSystem);
|
_requestBuildinPackageVersionOp = new RequestBuildinPackageVersionOperation(_fileSystem);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _requestBuildinPackageVersionOp);
|
_requestBuildinPackageVersionOp.StartOperation();
|
||||||
|
AddChildOperation(_requestBuildinPackageVersionOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_requestBuildinPackageVersionOp.UpdateOperation();
|
||||||
if (_requestBuildinPackageVersionOp.IsDone == false)
|
if (_requestBuildinPackageVersionOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -82,9 +84,11 @@ namespace YooAsset
|
|||||||
string destPath = GetCopyPackageHashDestPath(_buildinPackageVersion);
|
string destPath = GetCopyPackageHashDestPath(_buildinPackageVersion);
|
||||||
string url = DownloadSystemHelper.ConvertToWWWPath(sourcePath);
|
string url = DownloadSystemHelper.ConvertToWWWPath(sourcePath);
|
||||||
_hashFileRequestOp = new UnityWebFileRequestOperation(url, destPath);
|
_hashFileRequestOp = new UnityWebFileRequestOperation(url, destPath);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _hashFileRequestOp);
|
_hashFileRequestOp.StartOperation();
|
||||||
|
AddChildOperation(_hashFileRequestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_hashFileRequestOp.UpdateOperation();
|
||||||
if (_hashFileRequestOp.IsDone == false)
|
if (_hashFileRequestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -121,9 +125,11 @@ namespace YooAsset
|
|||||||
string destPath = GetCopyPackageManifestDestPath(_buildinPackageVersion);
|
string destPath = GetCopyPackageManifestDestPath(_buildinPackageVersion);
|
||||||
string url = DownloadSystemHelper.ConvertToWWWPath(sourcePath);
|
string url = DownloadSystemHelper.ConvertToWWWPath(sourcePath);
|
||||||
_manifestFileRequestOp = new UnityWebFileRequestOperation(url, destPath);
|
_manifestFileRequestOp = new UnityWebFileRequestOperation(url, destPath);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _manifestFileRequestOp);
|
_manifestFileRequestOp.StartOperation();
|
||||||
|
AddChildOperation(_manifestFileRequestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_manifestFileRequestOp.UpdateOperation();
|
||||||
if (_manifestFileRequestOp.IsDone == false)
|
if (_manifestFileRequestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadCatalog;
|
_steps = ESteps.LoadCatalog;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -31,11 +31,11 @@ namespace YooAsset
|
|||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
_packageHash = packageHash;
|
_packageHash = packageHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.RequestFileData;
|
_steps = ESteps.RequestFileData;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -47,9 +47,11 @@ namespace YooAsset
|
|||||||
string filePath = _fileSystem.GetBuildinPackageManifestFilePath(_packageVersion);
|
string filePath = _fileSystem.GetBuildinPackageManifestFilePath(_packageVersion);
|
||||||
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
||||||
_webDataRequestOp = new UnityWebDataRequestOperation(url);
|
_webDataRequestOp = new UnityWebDataRequestOperation(url);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _webDataRequestOp);
|
_webDataRequestOp.StartOperation();
|
||||||
|
AddChildOperation(_webDataRequestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_webDataRequestOp.UpdateOperation();
|
||||||
if (_webDataRequestOp.IsDone == false)
|
if (_webDataRequestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -85,9 +87,11 @@ namespace YooAsset
|
|||||||
if (_deserializer == null)
|
if (_deserializer == null)
|
||||||
{
|
{
|
||||||
_deserializer = new DeserializeManifestOperation(_webDataRequestOp.Result);
|
_deserializer = new DeserializeManifestOperation(_webDataRequestOp.Result);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _deserializer);
|
_deserializer.StartOperation();
|
||||||
|
AddChildOperation(_deserializer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_deserializer.UpdateOperation();
|
||||||
Progress = _deserializer.Progress;
|
Progress = _deserializer.Progress;
|
||||||
if (_deserializer.IsDone == false)
|
if (_deserializer.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.RequestPackageHash;
|
_steps = ESteps.RequestPackageHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -42,9 +42,11 @@ namespace YooAsset
|
|||||||
string filePath = _fileSystem.GetBuildinPackageHashFilePath(_packageVersion);
|
string filePath = _fileSystem.GetBuildinPackageHashFilePath(_packageVersion);
|
||||||
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
||||||
_webTextRequestOp = new UnityWebTextRequestOperation(url);
|
_webTextRequestOp = new UnityWebTextRequestOperation(url);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _webTextRequestOp);
|
_webTextRequestOp.StartOperation();
|
||||||
|
AddChildOperation(_webTextRequestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_webTextRequestOp.UpdateOperation();
|
||||||
if (_webTextRequestOp.IsDone == false)
|
if (_webTextRequestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -24,11 +24,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.RequestPackageVersion;
|
_steps = ESteps.RequestPackageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -40,9 +40,11 @@ namespace YooAsset
|
|||||||
string filePath = _fileSystem.GetBuildinPackageVersionFilePath();
|
string filePath = _fileSystem.GetBuildinPackageVersionFilePath();
|
||||||
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
||||||
_webTextRequestOp = new UnityWebTextRequestOperation(url);
|
_webTextRequestOp = new UnityWebTextRequestOperation(url);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _webTextRequestOp);
|
_webTextRequestOp.StartOperation();
|
||||||
|
AddChildOperation(_webTextRequestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_webTextRequestOp.UpdateOperation();
|
||||||
if (_webTextRequestOp.IsDone == false)
|
if (_webTextRequestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -15,13 +15,18 @@ namespace YooAsset
|
|||||||
protected readonly Dictionary<string, string> _bundleDataFilePathMapping = new Dictionary<string, string>(10000);
|
protected readonly Dictionary<string, string> _bundleDataFilePathMapping = new Dictionary<string, string>(10000);
|
||||||
protected readonly Dictionary<string, string> _bundleInfoFilePathMapping = new Dictionary<string, string>(10000);
|
protected readonly Dictionary<string, string> _bundleInfoFilePathMapping = new Dictionary<string, string>(10000);
|
||||||
protected readonly Dictionary<string, string> _tempFilePathMapping = new Dictionary<string, string>(10000);
|
protected readonly Dictionary<string, string> _tempFilePathMapping = new Dictionary<string, string>(10000);
|
||||||
protected DefaultCacheDownloadCenter _downloadCenter;
|
|
||||||
|
|
||||||
protected string _packageRoot;
|
protected string _packageRoot;
|
||||||
protected string _tempFilesRoot;
|
protected string _tempFilesRoot;
|
||||||
protected string _cacheBundleFilesRoot;
|
protected string _cacheBundleFilesRoot;
|
||||||
protected string _cacheManifestFilesRoot;
|
protected string _cacheManifestFilesRoot;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 下载中心
|
||||||
|
/// 说明:当异步操作任务终止的时候,所有下载子任务都会一同被终止!
|
||||||
|
/// </summary>
|
||||||
|
public DownloadCenterOperation DownloadCenter { set; get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 包裹名称
|
/// 包裹名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -98,19 +103,16 @@ namespace YooAsset
|
|||||||
public virtual FSInitializeFileSystemOperation InitializeFileSystemAsync()
|
public virtual FSInitializeFileSystemOperation InitializeFileSystemAsync()
|
||||||
{
|
{
|
||||||
var operation = new DCFSInitializeOperation(this);
|
var operation = new DCFSInitializeOperation(this);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSLoadPackageManifestOperation LoadPackageManifestAsync(string packageVersion, int timeout)
|
public virtual FSLoadPackageManifestOperation LoadPackageManifestAsync(string packageVersion, int timeout)
|
||||||
{
|
{
|
||||||
var operation = new DCFSLoadPackageManifestOperation(this, packageVersion, timeout);
|
var operation = new DCFSLoadPackageManifestOperation(this, packageVersion, timeout);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSRequestPackageVersionOperation RequestPackageVersionAsync(bool appendTimeTicks, int timeout)
|
public virtual FSRequestPackageVersionOperation RequestPackageVersionAsync(bool appendTimeTicks, int timeout)
|
||||||
{
|
{
|
||||||
var operation = new DCFSRequestPackageVersionOperation(this, appendTimeTicks, timeout);
|
var operation = new DCFSRequestPackageVersionOperation(this, appendTimeTicks, timeout);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSClearCacheFilesOperation ClearCacheFilesAsync(PackageManifest manifest, string clearMode, object clearParam)
|
public virtual FSClearCacheFilesOperation ClearCacheFilesAsync(PackageManifest manifest, string clearMode, object clearParam)
|
||||||
@@ -118,64 +120,60 @@ namespace YooAsset
|
|||||||
if (clearMode == EFileClearMode.ClearAllBundleFiles.ToString())
|
if (clearMode == EFileClearMode.ClearAllBundleFiles.ToString())
|
||||||
{
|
{
|
||||||
var operation = new ClearAllCacheBundleFilesOperation(this);
|
var operation = new ClearAllCacheBundleFilesOperation(this);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (clearMode == EFileClearMode.ClearUnusedBundleFiles.ToString())
|
else if (clearMode == EFileClearMode.ClearUnusedBundleFiles.ToString())
|
||||||
{
|
{
|
||||||
var operation = new ClearUnusedCacheBundleFilesOperation(this, manifest);
|
var operation = new ClearUnusedCacheBundleFilesOperation(this, manifest);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (clearMode == EFileClearMode.ClearBundleFilesByTags.ToString())
|
else if (clearMode == EFileClearMode.ClearBundleFilesByTags.ToString())
|
||||||
{
|
{
|
||||||
var operation = new ClearCacheBundleFilesByTagsOperaiton(this, manifest, clearParam);
|
var operation = new ClearCacheBundleFilesByTagsOperaiton(this, manifest, clearParam);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (clearMode == EFileClearMode.ClearAllManifestFiles.ToString())
|
else if (clearMode == EFileClearMode.ClearAllManifestFiles.ToString())
|
||||||
{
|
{
|
||||||
var operation = new ClearAllCacheManifestFilesOperation(this);
|
var operation = new ClearAllCacheManifestFilesOperation(this);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (clearMode == EFileClearMode.ClearUnusedManifestFiles.ToString())
|
else if (clearMode == EFileClearMode.ClearUnusedManifestFiles.ToString())
|
||||||
{
|
{
|
||||||
var operation = new ClearUnusedCacheManifestFilesOperation(this, manifest);
|
var operation = new ClearUnusedCacheManifestFilesOperation(this, manifest);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string error = $"Invalid clear mode : {clearMode}";
|
string error = $"Invalid clear mode : {clearMode}";
|
||||||
var operation = new FSClearCacheFilesCompleteOperation(error);
|
var operation = new FSClearCacheFilesCompleteOperation(error);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param)
|
public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param)
|
||||||
{
|
{
|
||||||
return _downloadCenter.DownloadFileAsync(bundle, param);
|
var downloader = DownloadCenter.DownloadFileAsync(bundle, param);
|
||||||
|
downloader.Reference(); //增加下载器的引用计数
|
||||||
|
|
||||||
|
// 注意:将下载器进行包裹,可以避免父类任务终止的时候,连带子任务里的下载器也一起被终止!
|
||||||
|
var wrapper = new DownloadFileWrapper(downloader);
|
||||||
|
return wrapper;
|
||||||
}
|
}
|
||||||
public virtual FSLoadBundleOperation LoadBundleFile(PackageBundle bundle)
|
public virtual FSLoadBundleOperation LoadBundleFile(PackageBundle bundle)
|
||||||
{
|
{
|
||||||
if (bundle.BundleType == (int)EBuildBundleType.AssetBundle)
|
if (bundle.BundleType == (int)EBuildBundleType.AssetBundle)
|
||||||
{
|
{
|
||||||
var operation = new DCFSLoadAssetBundleOperation(this, bundle);
|
var operation = new DCFSLoadAssetBundleOperation(this, bundle);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (bundle.BundleType == (int)EBuildBundleType.RawBundle)
|
else if (bundle.BundleType == (int)EBuildBundleType.RawBundle)
|
||||||
{
|
{
|
||||||
var operation = new DCFSLoadRawBundleOperation(this, bundle);
|
var operation = new DCFSLoadRawBundleOperation(this, bundle);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string error = $"{nameof(DefaultCacheFileSystem)} not support load bundle type : {bundle.BundleType}";
|
string error = $"{nameof(DefaultCacheFileSystem)} not support load bundle type : {bundle.BundleType}";
|
||||||
var operation = new FSLoadBundleCompleteOperation(error);
|
var operation = new FSLoadBundleCompleteOperation(error);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -231,11 +229,14 @@ namespace YooAsset
|
|||||||
_cacheBundleFilesRoot = PathUtility.Combine(_packageRoot, DefaultCacheFileSystemDefine.BundleFilesFolderName);
|
_cacheBundleFilesRoot = PathUtility.Combine(_packageRoot, DefaultCacheFileSystemDefine.BundleFilesFolderName);
|
||||||
_tempFilesRoot = PathUtility.Combine(_packageRoot, DefaultCacheFileSystemDefine.TempFilesFolderName);
|
_tempFilesRoot = PathUtility.Combine(_packageRoot, DefaultCacheFileSystemDefine.TempFilesFolderName);
|
||||||
_cacheManifestFilesRoot = PathUtility.Combine(_packageRoot, DefaultCacheFileSystemDefine.ManifestFilesFolderName);
|
_cacheManifestFilesRoot = PathUtility.Combine(_packageRoot, DefaultCacheFileSystemDefine.ManifestFilesFolderName);
|
||||||
_downloadCenter = new DefaultCacheDownloadCenter(this);
|
|
||||||
}
|
}
|
||||||
public virtual void OnUpdate()
|
public virtual void OnDestroy()
|
||||||
{
|
{
|
||||||
_downloadCenter.Update();
|
if (DownloadCenter != null)
|
||||||
|
{
|
||||||
|
DownloadCenter.AbortOperation();
|
||||||
|
DownloadCenter = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool Belong(PackageBundle bundle)
|
public virtual bool Belong(PackageBundle bundle)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ namespace YooAsset
|
|||||||
CheckAppFootPrint,
|
CheckAppFootPrint,
|
||||||
SearchCacheFiles,
|
SearchCacheFiles,
|
||||||
VerifyCacheFiles,
|
VerifyCacheFiles,
|
||||||
|
CreateDownloadCenter,
|
||||||
Done,
|
Done,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
#if UNITY_WEBGL
|
#if UNITY_WEBGL
|
||||||
_steps = ESteps.Done;
|
_steps = ESteps.Done;
|
||||||
@@ -32,7 +33,7 @@ namespace YooAsset
|
|||||||
_steps = ESteps.CheckAppFootPrint;
|
_steps = ESteps.CheckAppFootPrint;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -58,9 +59,11 @@ namespace YooAsset
|
|||||||
if (_searchCacheFilesOp == null)
|
if (_searchCacheFilesOp == null)
|
||||||
{
|
{
|
||||||
_searchCacheFilesOp = new SearchCacheFilesOperation(_fileSystem);
|
_searchCacheFilesOp = new SearchCacheFilesOperation(_fileSystem);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _searchCacheFilesOp);
|
_searchCacheFilesOp.StartOperation();
|
||||||
|
AddChildOperation(_searchCacheFilesOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_searchCacheFilesOp.UpdateOperation();
|
||||||
Progress = _searchCacheFilesOp.Progress;
|
Progress = _searchCacheFilesOp.Progress;
|
||||||
if (_searchCacheFilesOp.IsDone == false)
|
if (_searchCacheFilesOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
@@ -73,17 +76,18 @@ namespace YooAsset
|
|||||||
if (_verifyCacheFilesOp == null)
|
if (_verifyCacheFilesOp == null)
|
||||||
{
|
{
|
||||||
_verifyCacheFilesOp = new VerifyCacheFilesOperation(_fileSystem, _searchCacheFilesOp.Result);
|
_verifyCacheFilesOp = new VerifyCacheFilesOperation(_fileSystem, _searchCacheFilesOp.Result);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _verifyCacheFilesOp);
|
_verifyCacheFilesOp.StartOperation();
|
||||||
|
AddChildOperation(_verifyCacheFilesOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_verifyCacheFilesOp.UpdateOperation();
|
||||||
Progress = _verifyCacheFilesOp.Progress;
|
Progress = _verifyCacheFilesOp.Progress;
|
||||||
if (_verifyCacheFilesOp.IsDone == false)
|
if (_verifyCacheFilesOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_verifyCacheFilesOp.Status == EOperationStatus.Succeed)
|
if (_verifyCacheFilesOp.Status == EOperationStatus.Succeed)
|
||||||
{
|
{
|
||||||
_steps = ESteps.Done;
|
_steps = ESteps.CreateDownloadCenter;
|
||||||
Status = EOperationStatus.Succeed;
|
|
||||||
YooLogger.Log($"Package '{_fileSystem.PackageName}' cached files count : {_fileSystem.FileCount}");
|
YooLogger.Log($"Package '{_fileSystem.PackageName}' cached files count : {_fileSystem.FileCount}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -93,6 +97,19 @@ namespace YooAsset
|
|||||||
Error = _verifyCacheFilesOp.Error;
|
Error = _verifyCacheFilesOp.Error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_steps == ESteps.CreateDownloadCenter)
|
||||||
|
{
|
||||||
|
// 注意:下载中心作为独立任务运行!
|
||||||
|
if (_fileSystem.DownloadCenter == null)
|
||||||
|
{
|
||||||
|
_fileSystem.DownloadCenter = new DownloadCenterOperation(_fileSystem);
|
||||||
|
OperationSystem.StartOperation(_fileSystem.PackageName, _fileSystem.DownloadCenter);
|
||||||
|
}
|
||||||
|
|
||||||
|
_steps = ESteps.Done;
|
||||||
|
Status = EOperationStatus.Succeed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,11 +29,11 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_bundle = bundle;
|
_bundle = bundle;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.CheckExist;
|
_steps = ESteps.CheckExist;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -54,15 +54,19 @@ namespace YooAsset
|
|||||||
|
|
||||||
if (_steps == ESteps.DownloadFile)
|
if (_steps == ESteps.DownloadFile)
|
||||||
{
|
{
|
||||||
|
// 注意:边玩边下下载器引用计数没有Release
|
||||||
if (_downloadFileOp == null)
|
if (_downloadFileOp == null)
|
||||||
{
|
{
|
||||||
DownloadParam downloadParam = new DownloadParam(int.MaxValue, 60);
|
DownloadParam downloadParam = new DownloadParam(int.MaxValue, 60);
|
||||||
_downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, downloadParam);
|
_downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, downloadParam);
|
||||||
|
_downloadFileOp.StartOperation();
|
||||||
|
AddChildOperation(_downloadFileOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsWaitForAsyncComplete)
|
if (IsWaitForAsyncComplete)
|
||||||
_downloadFileOp.WaitForAsyncComplete();
|
_downloadFileOp.WaitForAsyncComplete();
|
||||||
|
|
||||||
|
_downloadFileOp.UpdateOperation();
|
||||||
DownloadProgress = _downloadFileOp.DownloadProgress;
|
DownloadProgress = _downloadFileOp.DownloadProgress;
|
||||||
DownloadedBytes = _downloadFileOp.DownloadedBytes;
|
DownloadedBytes = _downloadFileOp.DownloadedBytes;
|
||||||
if (_downloadFileOp.IsDone == false)
|
if (_downloadFileOp.IsDone == false)
|
||||||
@@ -219,14 +223,6 @@ namespace YooAsset
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override void AbortDownloadOperation()
|
|
||||||
{
|
|
||||||
if (_steps == ESteps.DownloadFile)
|
|
||||||
{
|
|
||||||
if (_downloadFileOp != null)
|
|
||||||
_downloadFileOp.SetAbort();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class DCFSLoadRawBundleOperation : FSLoadBundleOperation
|
internal class DCFSLoadRawBundleOperation : FSLoadBundleOperation
|
||||||
@@ -251,11 +247,11 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_bundle = bundle;
|
_bundle = bundle;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.CheckExist;
|
_steps = ESteps.CheckExist;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -276,15 +272,19 @@ namespace YooAsset
|
|||||||
|
|
||||||
if (_steps == ESteps.DownloadFile)
|
if (_steps == ESteps.DownloadFile)
|
||||||
{
|
{
|
||||||
|
// 注意:边玩边下下载器引用计数没有Release
|
||||||
if (_downloadFileOp == null)
|
if (_downloadFileOp == null)
|
||||||
{
|
{
|
||||||
DownloadParam downloadParam = new DownloadParam(int.MaxValue, 60);
|
DownloadParam downloadParam = new DownloadParam(int.MaxValue, 60);
|
||||||
_downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, downloadParam);
|
_downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, downloadParam);
|
||||||
|
_downloadFileOp.StartOperation();
|
||||||
|
AddChildOperation(_downloadFileOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsWaitForAsyncComplete)
|
if (IsWaitForAsyncComplete)
|
||||||
_downloadFileOp.WaitForAsyncComplete();
|
_downloadFileOp.WaitForAsyncComplete();
|
||||||
|
|
||||||
|
_downloadFileOp.UpdateOperation();
|
||||||
DownloadProgress = _downloadFileOp.DownloadProgress;
|
DownloadProgress = _downloadFileOp.DownloadProgress;
|
||||||
DownloadedBytes = _downloadFileOp.DownloadedBytes;
|
DownloadedBytes = _downloadFileOp.DownloadedBytes;
|
||||||
if (_downloadFileOp.IsDone == false)
|
if (_downloadFileOp.IsDone == false)
|
||||||
@@ -335,13 +335,5 @@ namespace YooAsset
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override void AbortDownloadOperation()
|
|
||||||
{
|
|
||||||
if (_steps == ESteps.DownloadFile)
|
|
||||||
{
|
|
||||||
if (_downloadFileOp != null)
|
|
||||||
_downloadFileOp.SetAbort();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -30,11 +30,11 @@ namespace YooAsset
|
|||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
_timeout = timeout;
|
_timeout = timeout;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.DownloadPackageHash;
|
_steps = ESteps.DownloadPackageHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -44,9 +44,11 @@ namespace YooAsset
|
|||||||
if (_downloadPackageHashOp == null)
|
if (_downloadPackageHashOp == null)
|
||||||
{
|
{
|
||||||
_downloadPackageHashOp = new DownloadPackageHashOperation(_fileSystem, _packageVersion, _timeout);
|
_downloadPackageHashOp = new DownloadPackageHashOperation(_fileSystem, _packageVersion, _timeout);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _downloadPackageHashOp);
|
_downloadPackageHashOp.StartOperation();
|
||||||
|
AddChildOperation(_downloadPackageHashOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_downloadPackageHashOp.UpdateOperation();
|
||||||
if (_downloadPackageHashOp.IsDone == false)
|
if (_downloadPackageHashOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -67,9 +69,11 @@ namespace YooAsset
|
|||||||
if (_downloadPackageManifestOp == null)
|
if (_downloadPackageManifestOp == null)
|
||||||
{
|
{
|
||||||
_downloadPackageManifestOp = new DownloadPackageManifestOperation(_fileSystem, _packageVersion, _timeout);
|
_downloadPackageManifestOp = new DownloadPackageManifestOperation(_fileSystem, _packageVersion, _timeout);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _downloadPackageManifestOp);
|
_downloadPackageManifestOp.StartOperation();
|
||||||
|
AddChildOperation(_downloadPackageManifestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_downloadPackageManifestOp.UpdateOperation();
|
||||||
if (_downloadPackageManifestOp.IsDone == false)
|
if (_downloadPackageManifestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -90,9 +94,11 @@ namespace YooAsset
|
|||||||
if (_loadCachePackageHashOp == null)
|
if (_loadCachePackageHashOp == null)
|
||||||
{
|
{
|
||||||
_loadCachePackageHashOp = new LoadCachePackageHashOperation(_fileSystem, _packageVersion);
|
_loadCachePackageHashOp = new LoadCachePackageHashOperation(_fileSystem, _packageVersion);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _loadCachePackageHashOp);
|
_loadCachePackageHashOp.StartOperation();
|
||||||
|
AddChildOperation(_loadCachePackageHashOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_loadCachePackageHashOp.UpdateOperation();
|
||||||
if (_loadCachePackageHashOp.IsDone == false)
|
if (_loadCachePackageHashOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -115,9 +121,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
string packageHash = _loadCachePackageHashOp.PackageHash;
|
string packageHash = _loadCachePackageHashOp.PackageHash;
|
||||||
_loadCachePackageManifestOp = new LoadCachePackageManifestOperation(_fileSystem, _packageVersion, packageHash);
|
_loadCachePackageManifestOp = new LoadCachePackageManifestOperation(_fileSystem, _packageVersion, packageHash);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _loadCachePackageManifestOp);
|
_loadCachePackageManifestOp.StartOperation();
|
||||||
|
AddChildOperation(_loadCachePackageManifestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_loadCachePackageManifestOp.UpdateOperation();
|
||||||
Progress = _loadCachePackageManifestOp.Progress;
|
Progress = _loadCachePackageManifestOp.Progress;
|
||||||
if (_loadCachePackageManifestOp.IsDone == false)
|
if (_loadCachePackageManifestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ namespace YooAsset
|
|||||||
_appendTimeTicks = appendTimeTicks;
|
_appendTimeTicks = appendTimeTicks;
|
||||||
_timeout = timeout;
|
_timeout = timeout;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.GetPackageVersion;
|
_steps = ESteps.GetPackageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -37,9 +37,11 @@ namespace YooAsset
|
|||||||
if (_requestRemotePackageVersionOp == null)
|
if (_requestRemotePackageVersionOp == null)
|
||||||
{
|
{
|
||||||
_requestRemotePackageVersionOp = new RequestRemotePackageVersionOperation(_fileSystem, _appendTimeTicks, _timeout);
|
_requestRemotePackageVersionOp = new RequestRemotePackageVersionOperation(_fileSystem, _appendTimeTicks, _timeout);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _requestRemotePackageVersionOp);
|
_requestRemotePackageVersionOp.StartOperation();
|
||||||
|
AddChildOperation(_requestRemotePackageVersionOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_requestRemotePackageVersionOp.UpdateOperation();
|
||||||
Progress = _requestRemotePackageVersionOp.Progress;
|
Progress = _requestRemotePackageVersionOp.Progress;
|
||||||
if (_requestRemotePackageVersionOp.IsDone == false)
|
if (_requestRemotePackageVersionOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.GetAllCacheFiles;
|
_steps = ESteps.GetAllCacheFiles;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.ClearAllCacheFiles;
|
_steps = ESteps.ClearAllCacheFiles;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ namespace YooAsset
|
|||||||
_manifest = manifest;
|
_manifest = manifest;
|
||||||
_clearParam = clearParam;
|
_clearParam = clearParam;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.CheckArgs;
|
_steps = ESteps.CheckArgs;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_manifest = manifest;
|
_manifest = manifest;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.GetUnusedCacheFiles;
|
_steps = ESteps.GetUnusedCacheFiles;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_manifest = manifest;
|
_manifest = manifest;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.ClearUnusedCacheFiles;
|
_steps = ESteps.ClearUnusedCacheFiles;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -3,33 +3,33 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
internal class DefaultCacheDownloadCenter
|
internal class DownloadCenterOperation : AsyncOperationBase
|
||||||
{
|
{
|
||||||
private readonly DefaultCacheFileSystem _fileSystem;
|
private readonly DefaultCacheFileSystem _fileSystem;
|
||||||
protected readonly Dictionary<string, DefaultDownloadFileOperation> _downloaders = new Dictionary<string, DefaultDownloadFileOperation>(1000);
|
protected readonly Dictionary<string, DefaultDownloadFileOperation> _downloaders = new Dictionary<string, DefaultDownloadFileOperation>(1000);
|
||||||
protected readonly List<string> _removeDownloadList = new List<string>(1000);
|
protected readonly List<string> _removeDownloadList = new List<string>(1000);
|
||||||
|
|
||||||
public DefaultCacheDownloadCenter(DefaultCacheFileSystem fileSystem)
|
public DownloadCenterOperation(DefaultCacheFileSystem fileSystem)
|
||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
|
internal override void InternalStart()
|
||||||
/// <summary>
|
{
|
||||||
/// 更新下载中心
|
}
|
||||||
/// </summary>
|
internal override void InternalUpdate()
|
||||||
public void Update()
|
|
||||||
{
|
{
|
||||||
// 获取可移除的下载器集合
|
// 获取可移除的下载器集合
|
||||||
_removeDownloadList.Clear();
|
_removeDownloadList.Clear();
|
||||||
foreach (var valuePair in _downloaders)
|
foreach (var valuePair in _downloaders)
|
||||||
{
|
{
|
||||||
var downloader = valuePair.Value;
|
var downloader = valuePair.Value;
|
||||||
|
downloader.UpdateOperation();
|
||||||
|
|
||||||
// 注意:主动终止引用计数为零的下载任务
|
// 注意:主动终止引用计数为零的下载任务
|
||||||
if (downloader.RefCount <= 0)
|
if (downloader.RefCount <= 0)
|
||||||
{
|
{
|
||||||
_removeDownloadList.Add(valuePair.Key);
|
_removeDownloadList.Add(valuePair.Key);
|
||||||
downloader.SetAbort();
|
downloader.AbortOperation();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ namespace YooAsset
|
|||||||
var operation = operationPair.Value;
|
var operation = operationPair.Value;
|
||||||
if (operation.Status == EOperationStatus.None)
|
if (operation.Status == EOperationStatus.None)
|
||||||
{
|
{
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
operation.StartOperation();
|
||||||
startCount--;
|
startCount--;
|
||||||
if (startCount <= 0)
|
if (startCount <= 0)
|
||||||
break;
|
break;
|
||||||
@@ -79,7 +79,6 @@ namespace YooAsset
|
|||||||
// 查询旧的下载器
|
// 查询旧的下载器
|
||||||
if (_downloaders.TryGetValue(bundle.BundleGUID, out var oldDownloader))
|
if (_downloaders.TryGetValue(bundle.BundleGUID, out var oldDownloader))
|
||||||
{
|
{
|
||||||
oldDownloader.Reference();
|
|
||||||
return oldDownloader;
|
return oldDownloader;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,13 +100,13 @@ namespace YooAsset
|
|||||||
if (bundle.FileSize >= _fileSystem.ResumeDownloadMinimumSize)
|
if (bundle.FileSize >= _fileSystem.ResumeDownloadMinimumSize)
|
||||||
{
|
{
|
||||||
newDownloader = new DownloadResumeFileOperation(_fileSystem, bundle, param);
|
newDownloader = new DownloadResumeFileOperation(_fileSystem, bundle, param);
|
||||||
newDownloader.Reference();
|
AddChildOperation(newDownloader);
|
||||||
_downloaders.Add(bundle.BundleGUID, newDownloader);
|
_downloaders.Add(bundle.BundleGUID, newDownloader);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newDownloader = new DownloadNormalFileOperation(_fileSystem, bundle, param);
|
newDownloader = new DownloadNormalFileOperation(_fileSystem, bundle, param);
|
||||||
newDownloader.Reference();
|
AddChildOperation(newDownloader);
|
||||||
_downloaders.Add(bundle.BundleGUID, newDownloader);
|
_downloaders.Add(bundle.BundleGUID, newDownloader);
|
||||||
}
|
}
|
||||||
return newDownloader;
|
return newDownloader;
|
||||||
@@ -16,13 +16,13 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_isReuqestLocalFile = DownloadSystemHelper.IsRequestLocalFile(Param.MainURL);
|
_isReuqestLocalFile = DownloadSystemHelper.IsRequestLocalFile(Param.MainURL);
|
||||||
_tempFilePath = _fileSystem.GetTempFilePath(Bundle);
|
_tempFilePath = _fileSystem.GetTempFilePath(Bundle);
|
||||||
_steps = ESteps.CheckExists;
|
_steps = ESteps.CheckExists;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -89,7 +89,8 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
var element = new TempFileElement(_tempFilePath, Bundle.FileCRC, Bundle.FileSize);
|
var element = new TempFileElement(_tempFilePath, Bundle.FileCRC, Bundle.FileSize);
|
||||||
_verifyOperation = new VerifyTempFileOperation(element);
|
_verifyOperation = new VerifyTempFileOperation(element);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _verifyOperation);
|
_verifyOperation.StartOperation();
|
||||||
|
AddChildOperation(_verifyOperation);
|
||||||
_steps = ESteps.CheckVerifyTempFile;
|
_steps = ESteps.CheckVerifyTempFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,6 +100,7 @@ namespace YooAsset
|
|||||||
if (IsWaitForAsyncComplete)
|
if (IsWaitForAsyncComplete)
|
||||||
_verifyOperation.WaitForAsyncComplete();
|
_verifyOperation.WaitForAsyncComplete();
|
||||||
|
|
||||||
|
_verifyOperation.UpdateOperation();
|
||||||
if (_verifyOperation.IsDone == false)
|
if (_verifyOperation.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -157,25 +159,19 @@ namespace YooAsset
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
internal override void InternalOnAbort()
|
internal override void InternalAbort()
|
||||||
{
|
{
|
||||||
_steps = ESteps.Done;
|
_steps = ESteps.Done;
|
||||||
DisposeWebRequest();
|
DisposeWebRequest();
|
||||||
}
|
}
|
||||||
internal override void InternalWaitForAsyncComplete()
|
internal override void InternalWaitForAsyncComplete()
|
||||||
{
|
{
|
||||||
//TODO 防止下载器挂起陷入无限死循环!
|
|
||||||
if (_steps == ESteps.None)
|
|
||||||
{
|
|
||||||
InternalOnStart();
|
|
||||||
}
|
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
//TODO 如果是导入或解压本地文件,执行等待完毕
|
//TODO 如果是导入或解压本地文件,执行等待完毕
|
||||||
if (_isReuqestLocalFile)
|
if (_isReuqestLocalFile)
|
||||||
{
|
{
|
||||||
InternalOnUpdate();
|
InternalUpdate();
|
||||||
if (IsDone)
|
if (IsDone)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,12 +26,12 @@ namespace YooAsset
|
|||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
_timeout = timeout;
|
_timeout = timeout;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_requestCount = WebRequestCounter.GetRequestFailedCount(_fileSystem.PackageName, nameof(DownloadPackageHashOperation));
|
_requestCount = WebRequestCounter.GetRequestFailedCount(_fileSystem.PackageName, nameof(DownloadPackageHashOperation));
|
||||||
_steps = ESteps.CheckExist;
|
_steps = ESteps.CheckExist;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -58,9 +58,11 @@ namespace YooAsset
|
|||||||
string fileName = YooAssetSettingsData.GetPackageHashFileName(_fileSystem.PackageName, _packageVersion);
|
string fileName = YooAssetSettingsData.GetPackageHashFileName(_fileSystem.PackageName, _packageVersion);
|
||||||
string webURL = GetWebRequestURL(fileName);
|
string webURL = GetWebRequestURL(fileName);
|
||||||
_webFileRequestOp = new UnityWebFileRequestOperation(webURL, savePath, _timeout);
|
_webFileRequestOp = new UnityWebFileRequestOperation(webURL, savePath, _timeout);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _webFileRequestOp);
|
_webFileRequestOp.StartOperation();
|
||||||
|
AddChildOperation(_webFileRequestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_webFileRequestOp.UpdateOperation();
|
||||||
if (_webFileRequestOp.IsDone == false)
|
if (_webFileRequestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -26,12 +26,12 @@ namespace YooAsset
|
|||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
_timeout = timeout;
|
_timeout = timeout;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_requestCount = WebRequestCounter.GetRequestFailedCount(_fileSystem.PackageName, nameof(DownloadPackageManifestOperation));
|
_requestCount = WebRequestCounter.GetRequestFailedCount(_fileSystem.PackageName, nameof(DownloadPackageManifestOperation));
|
||||||
_steps = ESteps.CheckExist;
|
_steps = ESteps.CheckExist;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -58,9 +58,11 @@ namespace YooAsset
|
|||||||
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(_fileSystem.PackageName, _packageVersion);
|
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(_fileSystem.PackageName, _packageVersion);
|
||||||
string webURL = GetDownloadRequestURL(fileName);
|
string webURL = GetDownloadRequestURL(fileName);
|
||||||
_webFileRequestOp = new UnityWebFileRequestOperation(webURL, savePath, _timeout);
|
_webFileRequestOp = new UnityWebFileRequestOperation(webURL, savePath, _timeout);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _webFileRequestOp);
|
_webFileRequestOp.StartOperation();
|
||||||
|
AddChildOperation(_webFileRequestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_webFileRequestOp.UpdateOperation();
|
||||||
if (_webFileRequestOp.IsDone == false)
|
if (_webFileRequestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using System.IO;
|
||||||
using System.IO;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Networking;
|
using UnityEngine.Networking;
|
||||||
|
|
||||||
@@ -20,13 +19,13 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_isReuqestLocalFile = DownloadSystemHelper.IsRequestLocalFile(Param.MainURL);
|
_isReuqestLocalFile = DownloadSystemHelper.IsRequestLocalFile(Param.MainURL);
|
||||||
_tempFilePath = _fileSystem.GetTempFilePath(Bundle);
|
_tempFilePath = _fileSystem.GetTempFilePath(Bundle);
|
||||||
_steps = ESteps.CheckExists;
|
_steps = ESteps.CheckExists;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -110,7 +109,8 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
var element = new TempFileElement(_tempFilePath, Bundle.FileCRC, Bundle.FileSize);
|
var element = new TempFileElement(_tempFilePath, Bundle.FileCRC, Bundle.FileSize);
|
||||||
_verifyOperation = new VerifyTempFileOperation(element);
|
_verifyOperation = new VerifyTempFileOperation(element);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _verifyOperation);
|
_verifyOperation.StartOperation();
|
||||||
|
AddChildOperation(_verifyOperation);
|
||||||
_steps = ESteps.CheckVerifyTempFile;
|
_steps = ESteps.CheckVerifyTempFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,6 +120,7 @@ namespace YooAsset
|
|||||||
if (IsWaitForAsyncComplete)
|
if (IsWaitForAsyncComplete)
|
||||||
_verifyOperation.WaitForAsyncComplete();
|
_verifyOperation.WaitForAsyncComplete();
|
||||||
|
|
||||||
|
_verifyOperation.UpdateOperation();
|
||||||
if (_verifyOperation.IsDone == false)
|
if (_verifyOperation.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -177,25 +178,19 @@ namespace YooAsset
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
internal override void InternalOnAbort()
|
internal override void InternalAbort()
|
||||||
{
|
{
|
||||||
_steps = ESteps.Done;
|
_steps = ESteps.Done;
|
||||||
DisposeWebRequest();
|
DisposeWebRequest();
|
||||||
}
|
}
|
||||||
internal override void InternalWaitForAsyncComplete()
|
internal override void InternalWaitForAsyncComplete()
|
||||||
{
|
{
|
||||||
//TODO 防止下载器挂起陷入无限死循环!
|
|
||||||
if (_steps == ESteps.None)
|
|
||||||
{
|
|
||||||
InternalOnStart();
|
|
||||||
}
|
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
//TODO 如果是导入或解压本地文件,执行等待完毕
|
//TODO 如果是导入或解压本地文件,执行等待完毕
|
||||||
if (_isReuqestLocalFile)
|
if (_isReuqestLocalFile)
|
||||||
{
|
{
|
||||||
InternalOnUpdate();
|
InternalUpdate();
|
||||||
if (IsDone)
|
if (IsDone)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadPackageHash;
|
_steps = ESteps.LoadPackageHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -32,11 +32,11 @@ namespace YooAsset
|
|||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
_packageHash = packageHash;
|
_packageHash = packageHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadFileData;
|
_steps = ESteps.LoadFileData;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -77,9 +77,11 @@ namespace YooAsset
|
|||||||
if (_deserializer == null)
|
if (_deserializer == null)
|
||||||
{
|
{
|
||||||
_deserializer = new DeserializeManifestOperation(_fileData);
|
_deserializer = new DeserializeManifestOperation(_fileData);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _deserializer);
|
_deserializer.StartOperation();
|
||||||
|
AddChildOperation(_deserializer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_deserializer.UpdateOperation();
|
||||||
Progress = _deserializer.Progress;
|
Progress = _deserializer.Progress;
|
||||||
if (_deserializer.IsDone == false)
|
if (_deserializer.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -29,12 +29,12 @@ namespace YooAsset
|
|||||||
_appendTimeTicks = appendTimeTicks;
|
_appendTimeTicks = appendTimeTicks;
|
||||||
_timeout = timeout;
|
_timeout = timeout;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_requestCount = WebRequestCounter.GetRequestFailedCount(_fileSystem.PackageName, nameof(RequestRemotePackageVersionOperation));
|
_requestCount = WebRequestCounter.GetRequestFailedCount(_fileSystem.PackageName, nameof(RequestRemotePackageVersionOperation));
|
||||||
_steps = ESteps.RequestPackageVersion;
|
_steps = ESteps.RequestPackageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -46,9 +46,11 @@ namespace YooAsset
|
|||||||
string fileName = YooAssetSettingsData.GetPackageVersionFileName(_fileSystem.PackageName);
|
string fileName = YooAssetSettingsData.GetPackageVersionFileName(_fileSystem.PackageName);
|
||||||
string url = GetWebRequestURL(fileName);
|
string url = GetWebRequestURL(fileName);
|
||||||
_webTextRequestOp = new UnityWebTextRequestOperation(url, _timeout);
|
_webTextRequestOp = new UnityWebTextRequestOperation(url, _timeout);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _webTextRequestOp);
|
_webTextRequestOp.StartOperation();
|
||||||
|
AddChildOperation(_webTextRequestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_webTextRequestOp.UpdateOperation();
|
||||||
Progress = _webTextRequestOp.Progress;
|
Progress = _webTextRequestOp.Progress;
|
||||||
if (_webTextRequestOp.IsDone == false)
|
if (_webTextRequestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.Prepare;
|
_steps = ESteps.Prepare;
|
||||||
_verifyStartTime = UnityEngine.Time.realtimeSinceStartup;
|
_verifyStartTime = UnityEngine.Time.realtimeSinceStartup;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -37,12 +37,12 @@ namespace YooAsset
|
|||||||
_waitingList = elements;
|
_waitingList = elements;
|
||||||
_fileVerifyLevel = fileSystem.FileVerifyLevel;
|
_fileVerifyLevel = fileSystem.FileVerifyLevel;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.InitVerify;
|
_steps = ESteps.InitVerify;
|
||||||
_verifyStartTime = UnityEngine.Time.realtimeSinceStartup;
|
_verifyStartTime = UnityEngine.Time.realtimeSinceStartup;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_element = element;
|
_element = element;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.VerifyFile;
|
_steps = ESteps.VerifyFile;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -72,7 +72,7 @@ namespace YooAsset
|
|||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
//TODO 等待子线程验证文件完毕,该操作会挂起主线程
|
//TODO 等待子线程验证文件完毕,该操作会挂起主线程
|
||||||
InternalOnUpdate();
|
InternalUpdate();
|
||||||
if (IsDone)
|
if (IsDone)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,25 +54,21 @@ namespace YooAsset
|
|||||||
public virtual FSInitializeFileSystemOperation InitializeFileSystemAsync()
|
public virtual FSInitializeFileSystemOperation InitializeFileSystemAsync()
|
||||||
{
|
{
|
||||||
var operation = new DEFSInitializeOperation(this);
|
var operation = new DEFSInitializeOperation(this);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSLoadPackageManifestOperation LoadPackageManifestAsync(string packageVersion, int timeout)
|
public virtual FSLoadPackageManifestOperation LoadPackageManifestAsync(string packageVersion, int timeout)
|
||||||
{
|
{
|
||||||
var operation = new DEFSLoadPackageManifestOperation(this, packageVersion);
|
var operation = new DEFSLoadPackageManifestOperation(this, packageVersion);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSRequestPackageVersionOperation RequestPackageVersionAsync(bool appendTimeTicks, int timeout)
|
public virtual FSRequestPackageVersionOperation RequestPackageVersionAsync(bool appendTimeTicks, int timeout)
|
||||||
{
|
{
|
||||||
var operation = new DEFSRequestPackageVersionOperation(this);
|
var operation = new DEFSRequestPackageVersionOperation(this);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSClearCacheFilesOperation ClearCacheFilesAsync(PackageManifest manifest, string clearMode, object clearParam)
|
public virtual FSClearCacheFilesOperation ClearCacheFilesAsync(PackageManifest manifest, string clearMode, object clearParam)
|
||||||
{
|
{
|
||||||
var operation = new FSClearCacheFilesCompleteOperation();
|
var operation = new FSClearCacheFilesCompleteOperation();
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param)
|
public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param)
|
||||||
@@ -84,14 +80,12 @@ namespace YooAsset
|
|||||||
if (bundle.BundleType == (int)EBuildBundleType.VirtualBundle)
|
if (bundle.BundleType == (int)EBuildBundleType.VirtualBundle)
|
||||||
{
|
{
|
||||||
var operation = new DEFSLoadBundleOperation(this, bundle);
|
var operation = new DEFSLoadBundleOperation(this, bundle);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string error = $"{nameof(DefaultEditorFileSystem)} not support load bundle type : {bundle.BundleType}";
|
string error = $"{nameof(DefaultEditorFileSystem)} not support load bundle type : {bundle.BundleType}";
|
||||||
var operation = new FSLoadBundleCompleteOperation(error);
|
var operation = new FSLoadBundleCompleteOperation(error);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -120,7 +114,7 @@ namespace YooAsset
|
|||||||
|
|
||||||
_packageRoot = packageRoot;
|
_packageRoot = packageRoot;
|
||||||
}
|
}
|
||||||
public virtual void OnUpdate()
|
public virtual void OnDestroy()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSytem = fileSystem;
|
_fileSytem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
Status = EOperationStatus.Succeed;
|
Status = EOperationStatus.Succeed;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_bundle = bundle;
|
_bundle = bundle;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.DownloadFile;
|
_steps = ESteps.DownloadFile;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -72,8 +72,5 @@ namespace YooAsset
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override void AbortDownloadOperation()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,11 +23,11 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadEditorPackageHash;
|
_steps = ESteps.LoadEditorPackageHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -37,9 +37,11 @@ namespace YooAsset
|
|||||||
if (_loadEditorPackageHashOpe == null)
|
if (_loadEditorPackageHashOpe == null)
|
||||||
{
|
{
|
||||||
_loadEditorPackageHashOpe = new LoadEditorPackageHashOperation(_fileSystem, _packageVersion);
|
_loadEditorPackageHashOpe = new LoadEditorPackageHashOperation(_fileSystem, _packageVersion);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _loadEditorPackageHashOpe);
|
_loadEditorPackageHashOpe.StartOperation();
|
||||||
|
AddChildOperation(_loadEditorPackageHashOpe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_loadEditorPackageHashOpe.UpdateOperation();
|
||||||
if (_loadEditorPackageHashOpe.IsDone == false)
|
if (_loadEditorPackageHashOpe.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -61,9 +63,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
string packageHash = _loadEditorPackageHashOpe.PackageHash;
|
string packageHash = _loadEditorPackageHashOpe.PackageHash;
|
||||||
_loadEditorPackageManifestOp = new LoadEditorPackageManifestOperation(_fileSystem, _packageVersion, packageHash);
|
_loadEditorPackageManifestOp = new LoadEditorPackageManifestOperation(_fileSystem, _packageVersion, packageHash);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _loadEditorPackageManifestOp);
|
_loadEditorPackageManifestOp.StartOperation();
|
||||||
|
AddChildOperation(_loadEditorPackageManifestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_loadEditorPackageManifestOp.UpdateOperation();
|
||||||
Progress = _loadEditorPackageManifestOp.Progress;
|
Progress = _loadEditorPackageManifestOp.Progress;
|
||||||
if (_loadEditorPackageManifestOp.IsDone == false)
|
if (_loadEditorPackageManifestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadPackageVersion;
|
_steps = ESteps.LoadPackageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -33,9 +33,11 @@ namespace YooAsset
|
|||||||
if (_loadEditorPackageVersionOp == null)
|
if (_loadEditorPackageVersionOp == null)
|
||||||
{
|
{
|
||||||
_loadEditorPackageVersionOp = new LoadEditorPackageVersionOperation(_fileSystem);
|
_loadEditorPackageVersionOp = new LoadEditorPackageVersionOperation(_fileSystem);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _loadEditorPackageVersionOp);
|
_loadEditorPackageVersionOp.StartOperation();
|
||||||
|
AddChildOperation(_loadEditorPackageVersionOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_loadEditorPackageVersionOp.UpdateOperation();
|
||||||
if (_loadEditorPackageVersionOp.IsDone == false)
|
if (_loadEditorPackageVersionOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadHash;
|
_steps = ESteps.LoadHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -32,11 +32,11 @@ namespace YooAsset
|
|||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
_packageHash = packageHash;
|
_packageHash = packageHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadFileData;
|
_steps = ESteps.LoadFileData;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -77,9 +77,11 @@ namespace YooAsset
|
|||||||
if (_deserializer == null)
|
if (_deserializer == null)
|
||||||
{
|
{
|
||||||
_deserializer = new DeserializeManifestOperation(_fileData);
|
_deserializer = new DeserializeManifestOperation(_fileData);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _deserializer);
|
_deserializer.StartOperation();
|
||||||
|
AddChildOperation(_deserializer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_deserializer.UpdateOperation();
|
||||||
Progress = _deserializer.Progress;
|
Progress = _deserializer.Progress;
|
||||||
if (_deserializer.IsDone == false)
|
if (_deserializer.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -24,11 +24,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadVersion;
|
_steps = ESteps.LoadVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -61,25 +61,21 @@ namespace YooAsset
|
|||||||
public virtual FSInitializeFileSystemOperation InitializeFileSystemAsync()
|
public virtual FSInitializeFileSystemOperation InitializeFileSystemAsync()
|
||||||
{
|
{
|
||||||
var operation = new DWRFSInitializeOperation(this);
|
var operation = new DWRFSInitializeOperation(this);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSLoadPackageManifestOperation LoadPackageManifestAsync(string packageVersion, int timeout)
|
public virtual FSLoadPackageManifestOperation LoadPackageManifestAsync(string packageVersion, int timeout)
|
||||||
{
|
{
|
||||||
var operation = new DWRFSLoadPackageManifestOperation(this, packageVersion, timeout);
|
var operation = new DWRFSLoadPackageManifestOperation(this, packageVersion, timeout);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSRequestPackageVersionOperation RequestPackageVersionAsync(bool appendTimeTicks, int timeout)
|
public virtual FSRequestPackageVersionOperation RequestPackageVersionAsync(bool appendTimeTicks, int timeout)
|
||||||
{
|
{
|
||||||
var operation = new DWRFSRequestPackageVersionOperation(this, appendTimeTicks, timeout);
|
var operation = new DWRFSRequestPackageVersionOperation(this, appendTimeTicks, timeout);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSClearCacheFilesOperation ClearCacheFilesAsync(PackageManifest manifest, string clearMode, object clearParam)
|
public virtual FSClearCacheFilesOperation ClearCacheFilesAsync(PackageManifest manifest, string clearMode, object clearParam)
|
||||||
{
|
{
|
||||||
var operation = new FSClearCacheFilesCompleteOperation();
|
var operation = new FSClearCacheFilesCompleteOperation();
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param)
|
public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param)
|
||||||
@@ -91,14 +87,12 @@ namespace YooAsset
|
|||||||
if (bundle.BundleType == (int)EBuildBundleType.AssetBundle)
|
if (bundle.BundleType == (int)EBuildBundleType.AssetBundle)
|
||||||
{
|
{
|
||||||
var operation = new DWRFSLoadAssetBundleOperation(this, bundle);
|
var operation = new DWRFSLoadAssetBundleOperation(this, bundle);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string error = $"{nameof(DefaultWebRemoteFileSystem)} not support load bundle type : {bundle.BundleType}";
|
string error = $"{nameof(DefaultWebRemoteFileSystem)} not support load bundle type : {bundle.BundleType}";
|
||||||
var operation = new FSLoadBundleCompleteOperation(error);
|
var operation = new FSLoadBundleCompleteOperation(error);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -126,7 +120,7 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
PackageName = packageName;
|
PackageName = packageName;
|
||||||
}
|
}
|
||||||
public virtual void OnUpdate()
|
public virtual void OnDestroy()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
Status = EOperationStatus.Succeed;
|
Status = EOperationStatus.Succeed;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_bundle = bundle;
|
_bundle = bundle;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.DownloadAssetBundle;
|
_steps = ESteps.DownloadAssetBundle;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -41,15 +41,18 @@ namespace YooAsset
|
|||||||
if (_bundle.Encrypted)
|
if (_bundle.Encrypted)
|
||||||
{
|
{
|
||||||
_downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(true, _fileSystem.DecryptionServices, _bundle, downloadParam);
|
_downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(true, _fileSystem.DecryptionServices, _bundle, downloadParam);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _downloadAssetBundleOp);
|
_downloadAssetBundleOp.StartOperation();
|
||||||
|
AddChildOperation(_downloadAssetBundleOp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_downloadAssetBundleOp = new DownloadWebNormalAssetBundleOperation(_fileSystem.DisableUnityWebCache, _bundle, downloadParam);
|
_downloadAssetBundleOp = new DownloadWebNormalAssetBundleOperation(_fileSystem.DisableUnityWebCache, _bundle, downloadParam);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _downloadAssetBundleOp);
|
_downloadAssetBundleOp.StartOperation();
|
||||||
|
AddChildOperation(_downloadAssetBundleOp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_downloadAssetBundleOp.UpdateOperation();
|
||||||
DownloadProgress = _downloadAssetBundleOp.DownloadProgress;
|
DownloadProgress = _downloadAssetBundleOp.DownloadProgress;
|
||||||
DownloadedBytes = _downloadAssetBundleOp.DownloadedBytes;
|
DownloadedBytes = _downloadAssetBundleOp.DownloadedBytes;
|
||||||
Progress = _downloadAssetBundleOp.Progress;
|
Progress = _downloadAssetBundleOp.Progress;
|
||||||
@@ -90,13 +93,5 @@ namespace YooAsset
|
|||||||
UnityEngine.Debug.LogError(Error);
|
UnityEngine.Debug.LogError(Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override void AbortDownloadOperation()
|
|
||||||
{
|
|
||||||
if (_steps == ESteps.DownloadAssetBundle)
|
|
||||||
{
|
|
||||||
if (_downloadAssetBundleOp != null)
|
|
||||||
_downloadAssetBundleOp.SetAbort();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,11 +25,11 @@ namespace YooAsset
|
|||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
_timeout = timeout;
|
_timeout = timeout;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.RequestWebPackageHash;
|
_steps = ESteps.RequestWebPackageHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -39,9 +39,11 @@ namespace YooAsset
|
|||||||
if (_requestWebPackageHashOp == null)
|
if (_requestWebPackageHashOp == null)
|
||||||
{
|
{
|
||||||
_requestWebPackageHashOp = new RequestWebRemotePackageHashOperation(_fileSystem, _packageVersion, _timeout);
|
_requestWebPackageHashOp = new RequestWebRemotePackageHashOperation(_fileSystem, _packageVersion, _timeout);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _requestWebPackageHashOp);
|
_requestWebPackageHashOp.StartOperation();
|
||||||
|
AddChildOperation(_requestWebPackageHashOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_requestWebPackageHashOp.UpdateOperation();
|
||||||
if (_requestWebPackageHashOp.IsDone == false)
|
if (_requestWebPackageHashOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -63,9 +65,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
string packageHash = _requestWebPackageHashOp.PackageHash;
|
string packageHash = _requestWebPackageHashOp.PackageHash;
|
||||||
_loadWebPackageManifestOp = new LoadWebRemotePackageManifestOperation(_fileSystem, _packageVersion, packageHash);
|
_loadWebPackageManifestOp = new LoadWebRemotePackageManifestOperation(_fileSystem, _packageVersion, packageHash);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _loadWebPackageManifestOp);
|
_loadWebPackageManifestOp.StartOperation();
|
||||||
|
AddChildOperation(_loadWebPackageManifestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_loadWebPackageManifestOp.UpdateOperation();
|
||||||
Progress = _loadWebPackageManifestOp.Progress;
|
Progress = _loadWebPackageManifestOp.Progress;
|
||||||
if (_loadWebPackageManifestOp.IsDone == false)
|
if (_loadWebPackageManifestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ namespace YooAsset
|
|||||||
_appendTimeTicks = appendTimeTicks;
|
_appendTimeTicks = appendTimeTicks;
|
||||||
_timeout = timeout;
|
_timeout = timeout;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.RequestPackageVersion;
|
_steps = ESteps.RequestPackageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -37,9 +37,11 @@ namespace YooAsset
|
|||||||
if (_requestWebPackageVersionOp == null)
|
if (_requestWebPackageVersionOp == null)
|
||||||
{
|
{
|
||||||
_requestWebPackageVersionOp = new RequestWebRemotePackageVersionOperation(_fileSystem, _appendTimeTicks, _timeout);
|
_requestWebPackageVersionOp = new RequestWebRemotePackageVersionOperation(_fileSystem, _appendTimeTicks, _timeout);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _requestWebPackageVersionOp);
|
_requestWebPackageVersionOp.StartOperation();
|
||||||
|
AddChildOperation(_requestWebPackageVersionOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_requestWebPackageVersionOp.UpdateOperation();
|
||||||
Progress = _requestWebPackageVersionOp.Progress;
|
Progress = _requestWebPackageVersionOp.Progress;
|
||||||
if (_requestWebPackageVersionOp.IsDone == false)
|
if (_requestWebPackageVersionOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ namespace YooAsset
|
|||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
_packageHash = packageHash;
|
_packageHash = packageHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_requestCount = WebRequestCounter.GetRequestFailedCount(_fileSystem.PackageName, nameof(LoadWebRemotePackageManifestOperation));
|
_requestCount = WebRequestCounter.GetRequestFailedCount(_fileSystem.PackageName, nameof(LoadWebRemotePackageManifestOperation));
|
||||||
_steps = ESteps.RequestFileData;
|
_steps = ESteps.RequestFileData;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -49,9 +49,11 @@ namespace YooAsset
|
|||||||
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(_fileSystem.PackageName, _packageVersion);
|
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(_fileSystem.PackageName, _packageVersion);
|
||||||
string url = GetWebRequestURL(fileName);
|
string url = GetWebRequestURL(fileName);
|
||||||
_webDataRequestOp = new UnityWebDataRequestOperation(url);
|
_webDataRequestOp = new UnityWebDataRequestOperation(url);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _webDataRequestOp);
|
_webDataRequestOp.StartOperation();
|
||||||
|
AddChildOperation(_webDataRequestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_webDataRequestOp.UpdateOperation();
|
||||||
if (_webDataRequestOp.IsDone == false)
|
if (_webDataRequestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -88,9 +90,11 @@ namespace YooAsset
|
|||||||
if (_deserializer == null)
|
if (_deserializer == null)
|
||||||
{
|
{
|
||||||
_deserializer = new DeserializeManifestOperation(_webDataRequestOp.Result);
|
_deserializer = new DeserializeManifestOperation(_webDataRequestOp.Result);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _deserializer);
|
_deserializer.StartOperation();
|
||||||
|
AddChildOperation(_deserializer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_deserializer.UpdateOperation();
|
||||||
Progress = _deserializer.Progress;
|
Progress = _deserializer.Progress;
|
||||||
if (_deserializer.IsDone == false)
|
if (_deserializer.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -29,12 +29,12 @@ namespace YooAsset
|
|||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
_timeout = timeout;
|
_timeout = timeout;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_requestCount = WebRequestCounter.GetRequestFailedCount(_fileSystem.PackageName, nameof(RequestWebRemotePackageHashOperation));
|
_requestCount = WebRequestCounter.GetRequestFailedCount(_fileSystem.PackageName, nameof(RequestWebRemotePackageHashOperation));
|
||||||
_steps = ESteps.RequestPackageHash;
|
_steps = ESteps.RequestPackageHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -46,9 +46,11 @@ namespace YooAsset
|
|||||||
string fileName = YooAssetSettingsData.GetPackageHashFileName(_fileSystem.PackageName, _packageVersion);
|
string fileName = YooAssetSettingsData.GetPackageHashFileName(_fileSystem.PackageName, _packageVersion);
|
||||||
string url = GetWebRequestURL(fileName);
|
string url = GetWebRequestURL(fileName);
|
||||||
_webTextRequestOp = new UnityWebTextRequestOperation(url, _timeout);
|
_webTextRequestOp = new UnityWebTextRequestOperation(url, _timeout);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _webTextRequestOp);
|
_webTextRequestOp.StartOperation();
|
||||||
|
AddChildOperation(_webTextRequestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_webTextRequestOp.UpdateOperation();
|
||||||
Progress = _webTextRequestOp.Progress;
|
Progress = _webTextRequestOp.Progress;
|
||||||
if (_webTextRequestOp.IsDone == false)
|
if (_webTextRequestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -29,12 +29,12 @@ namespace YooAsset
|
|||||||
_appendTimeTicks = appendTimeTicks;
|
_appendTimeTicks = appendTimeTicks;
|
||||||
_timeout = timeout;
|
_timeout = timeout;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_requestCount = WebRequestCounter.GetRequestFailedCount(_fileSystem.PackageName, nameof(RequestWebRemotePackageVersionOperation));
|
_requestCount = WebRequestCounter.GetRequestFailedCount(_fileSystem.PackageName, nameof(RequestWebRemotePackageVersionOperation));
|
||||||
_steps = ESteps.RequestPackageVersion;
|
_steps = ESteps.RequestPackageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -46,9 +46,11 @@ namespace YooAsset
|
|||||||
string fileName = YooAssetSettingsData.GetPackageVersionFileName(_fileSystem.PackageName);
|
string fileName = YooAssetSettingsData.GetPackageVersionFileName(_fileSystem.PackageName);
|
||||||
string url = GetWebRequestURL(fileName);
|
string url = GetWebRequestURL(fileName);
|
||||||
_webTextRequestOp = new UnityWebTextRequestOperation(url, _timeout);
|
_webTextRequestOp = new UnityWebTextRequestOperation(url, _timeout);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _webTextRequestOp);
|
_webTextRequestOp.StartOperation();
|
||||||
|
AddChildOperation(_webTextRequestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_webTextRequestOp.UpdateOperation();
|
||||||
Progress = _webTextRequestOp.Progress;
|
Progress = _webTextRequestOp.Progress;
|
||||||
if (_webTextRequestOp.IsDone == false)
|
if (_webTextRequestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -70,25 +70,21 @@ namespace YooAsset
|
|||||||
public virtual FSInitializeFileSystemOperation InitializeFileSystemAsync()
|
public virtual FSInitializeFileSystemOperation InitializeFileSystemAsync()
|
||||||
{
|
{
|
||||||
var operation = new DWSFSInitializeOperation(this);
|
var operation = new DWSFSInitializeOperation(this);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSLoadPackageManifestOperation LoadPackageManifestAsync(string packageVersion, int timeout)
|
public virtual FSLoadPackageManifestOperation LoadPackageManifestAsync(string packageVersion, int timeout)
|
||||||
{
|
{
|
||||||
var operation = new DWSFSLoadPackageManifestOperation(this, packageVersion, timeout);
|
var operation = new DWSFSLoadPackageManifestOperation(this, packageVersion, timeout);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSRequestPackageVersionOperation RequestPackageVersionAsync(bool appendTimeTicks, int timeout)
|
public virtual FSRequestPackageVersionOperation RequestPackageVersionAsync(bool appendTimeTicks, int timeout)
|
||||||
{
|
{
|
||||||
var operation = new DWSFSRequestPackageVersionOperation(this, timeout);
|
var operation = new DWSFSRequestPackageVersionOperation(this, timeout);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSClearCacheFilesOperation ClearCacheFilesAsync(PackageManifest manifest, string clearMode, object clearParam)
|
public virtual FSClearCacheFilesOperation ClearCacheFilesAsync(PackageManifest manifest, string clearMode, object clearParam)
|
||||||
{
|
{
|
||||||
var operation = new FSClearCacheFilesCompleteOperation();
|
var operation = new FSClearCacheFilesCompleteOperation();
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param)
|
public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param)
|
||||||
@@ -100,14 +96,12 @@ namespace YooAsset
|
|||||||
if (bundle.BundleType == (int)EBuildBundleType.AssetBundle)
|
if (bundle.BundleType == (int)EBuildBundleType.AssetBundle)
|
||||||
{
|
{
|
||||||
var operation = new DWSFSLoadAssetBundleOperation(this, bundle);
|
var operation = new DWSFSLoadAssetBundleOperation(this, bundle);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string error = $"{nameof(DefaultWebServerFileSystem)} not support load bundle type : {bundle.BundleType}";
|
string error = $"{nameof(DefaultWebServerFileSystem)} not support load bundle type : {bundle.BundleType}";
|
||||||
var operation = new FSLoadBundleCompleteOperation(error);
|
var operation = new FSLoadBundleCompleteOperation(error);
|
||||||
OperationSystem.StartOperation(PackageName, operation);
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -136,7 +130,7 @@ namespace YooAsset
|
|||||||
else
|
else
|
||||||
_webPackageRoot = packageRoot;
|
_webPackageRoot = packageRoot;
|
||||||
}
|
}
|
||||||
public virtual void OnUpdate()
|
public virtual void OnDestroy()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
|
|
||||||
using static UnityEngine.Networking.UnityWebRequest;
|
|
||||||
|
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
internal class DWSFSInitializeOperation : FSInitializeFileSystemOperation
|
internal class DWSFSInitializeOperation : FSInitializeFileSystemOperation
|
||||||
@@ -21,11 +19,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadCatalogFile;
|
_steps = ESteps.LoadCatalogFile;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -49,9 +47,11 @@ namespace YooAsset
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
_loadCatalogFileOp = new LoadWebServerCatalogFileOperation(_fileSystem);
|
_loadCatalogFileOp = new LoadWebServerCatalogFileOperation(_fileSystem);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _loadCatalogFileOp);
|
_loadCatalogFileOp.StartOperation();
|
||||||
|
AddChildOperation(_loadCatalogFileOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_loadCatalogFileOp.UpdateOperation();
|
||||||
if (_loadCatalogFileOp.IsDone == false)
|
if (_loadCatalogFileOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_bundle = bundle;
|
_bundle = bundle;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.DownloadAssetBundle;
|
_steps = ESteps.DownloadAssetBundle;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -42,15 +42,18 @@ namespace YooAsset
|
|||||||
if (_bundle.Encrypted)
|
if (_bundle.Encrypted)
|
||||||
{
|
{
|
||||||
_downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(true, _fileSystem.DecryptionServices, _bundle, downloadParam);
|
_downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(true, _fileSystem.DecryptionServices, _bundle, downloadParam);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _downloadAssetBundleOp);
|
_downloadAssetBundleOp.StartOperation();
|
||||||
|
AddChildOperation(_downloadAssetBundleOp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_downloadAssetBundleOp = new DownloadWebNormalAssetBundleOperation(_fileSystem.DisableUnityWebCache, _bundle, downloadParam);
|
_downloadAssetBundleOp = new DownloadWebNormalAssetBundleOperation(_fileSystem.DisableUnityWebCache, _bundle, downloadParam);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _downloadAssetBundleOp);
|
_downloadAssetBundleOp.StartOperation();
|
||||||
|
AddChildOperation(_downloadAssetBundleOp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_downloadAssetBundleOp.UpdateOperation();
|
||||||
DownloadProgress = _downloadAssetBundleOp.DownloadProgress;
|
DownloadProgress = _downloadAssetBundleOp.DownloadProgress;
|
||||||
DownloadedBytes = _downloadAssetBundleOp.DownloadedBytes;
|
DownloadedBytes = _downloadAssetBundleOp.DownloadedBytes;
|
||||||
Progress = _downloadAssetBundleOp.Progress;
|
Progress = _downloadAssetBundleOp.Progress;
|
||||||
@@ -91,13 +94,5 @@ namespace YooAsset
|
|||||||
UnityEngine.Debug.LogError(Error);
|
UnityEngine.Debug.LogError(Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override void AbortDownloadOperation()
|
|
||||||
{
|
|
||||||
if (_steps == ESteps.DownloadAssetBundle)
|
|
||||||
{
|
|
||||||
if (_downloadAssetBundleOp != null)
|
|
||||||
_downloadAssetBundleOp.SetAbort();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,11 +25,11 @@ namespace YooAsset
|
|||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
_timeout = timeout;
|
_timeout = timeout;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.RequestWebPackageHash;
|
_steps = ESteps.RequestWebPackageHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -39,9 +39,11 @@ namespace YooAsset
|
|||||||
if (_requestWebPackageHashOp == null)
|
if (_requestWebPackageHashOp == null)
|
||||||
{
|
{
|
||||||
_requestWebPackageHashOp = new RequestWebServerPackageHashOperation(_fileSystem, _packageVersion, _timeout);
|
_requestWebPackageHashOp = new RequestWebServerPackageHashOperation(_fileSystem, _packageVersion, _timeout);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _requestWebPackageHashOp);
|
_requestWebPackageHashOp.StartOperation();
|
||||||
|
AddChildOperation(_requestWebPackageHashOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_requestWebPackageHashOp.UpdateOperation();
|
||||||
if (_requestWebPackageHashOp.IsDone == false)
|
if (_requestWebPackageHashOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -63,9 +65,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
string packageHash = _requestWebPackageHashOp.PackageHash;
|
string packageHash = _requestWebPackageHashOp.PackageHash;
|
||||||
_loadWebPackageManifestOp = new LoadWebServerPackageManifestOperation(_fileSystem, _packageVersion, packageHash);
|
_loadWebPackageManifestOp = new LoadWebServerPackageManifestOperation(_fileSystem, _packageVersion, packageHash);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _loadWebPackageManifestOp);
|
_loadWebPackageManifestOp.StartOperation();
|
||||||
|
AddChildOperation(_loadWebPackageManifestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_loadWebPackageManifestOp.UpdateOperation();
|
||||||
Progress = _loadWebPackageManifestOp.Progress;
|
Progress = _loadWebPackageManifestOp.Progress;
|
||||||
if (_loadWebPackageManifestOp.IsDone == false)
|
if (_loadWebPackageManifestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_timeout = timeout;
|
_timeout = timeout;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.RequestPackageVersion;
|
_steps = ESteps.RequestPackageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -35,9 +35,11 @@ namespace YooAsset
|
|||||||
if (_requestWebPackageVersionOp == null)
|
if (_requestWebPackageVersionOp == null)
|
||||||
{
|
{
|
||||||
_requestWebPackageVersionOp = new RequestWebServerPackageVersionOperation(_fileSystem, _timeout);
|
_requestWebPackageVersionOp = new RequestWebServerPackageVersionOperation(_fileSystem, _timeout);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _requestWebPackageVersionOp);
|
_requestWebPackageVersionOp.StartOperation();
|
||||||
|
AddChildOperation(_requestWebPackageVersionOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_requestWebPackageVersionOp.UpdateOperation();
|
||||||
Progress = _requestWebPackageVersionOp.Progress;
|
Progress = _requestWebPackageVersionOp.Progress;
|
||||||
if (_requestWebPackageVersionOp.IsDone == false)
|
if (_requestWebPackageVersionOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadCatalog;
|
_steps = ESteps.LoadCatalog;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -31,11 +31,11 @@ namespace YooAsset
|
|||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
_packageHash = packageHash;
|
_packageHash = packageHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.RequestFileData;
|
_steps = ESteps.RequestFileData;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -47,9 +47,11 @@ namespace YooAsset
|
|||||||
string filePath = _fileSystem.GetWebPackageManifestFilePath(_packageVersion);
|
string filePath = _fileSystem.GetWebPackageManifestFilePath(_packageVersion);
|
||||||
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
||||||
_webDataRequestOp = new UnityWebDataRequestOperation(url);
|
_webDataRequestOp = new UnityWebDataRequestOperation(url);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _webDataRequestOp);
|
_webDataRequestOp.StartOperation();
|
||||||
|
AddChildOperation(_webDataRequestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_webDataRequestOp.UpdateOperation();
|
||||||
if (_webDataRequestOp.IsDone == false)
|
if (_webDataRequestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -85,9 +87,11 @@ namespace YooAsset
|
|||||||
if (_deserializer == null)
|
if (_deserializer == null)
|
||||||
{
|
{
|
||||||
_deserializer = new DeserializeManifestOperation(_webDataRequestOp.Result);
|
_deserializer = new DeserializeManifestOperation(_webDataRequestOp.Result);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _deserializer);
|
_deserializer.StartOperation();
|
||||||
|
AddChildOperation(_deserializer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_deserializer.UpdateOperation();
|
||||||
Progress = _deserializer.Progress;
|
Progress = _deserializer.Progress;
|
||||||
if (_deserializer.IsDone == false)
|
if (_deserializer.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ namespace YooAsset
|
|||||||
_packageVersion = packageVersion;
|
_packageVersion = packageVersion;
|
||||||
_timeout = timeout;
|
_timeout = timeout;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.RequestPackageHash;
|
_steps = ESteps.RequestPackageHash;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -44,9 +44,11 @@ namespace YooAsset
|
|||||||
string filePath = _fileSystem.GetWebPackageHashFilePath(_packageVersion);
|
string filePath = _fileSystem.GetWebPackageHashFilePath(_packageVersion);
|
||||||
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
||||||
_webTextRequestOp = new UnityWebTextRequestOperation(url, _timeout);
|
_webTextRequestOp = new UnityWebTextRequestOperation(url, _timeout);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _webTextRequestOp);
|
_webTextRequestOp.StartOperation();
|
||||||
|
AddChildOperation(_webTextRequestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_webTextRequestOp.UpdateOperation();
|
||||||
Progress = _webTextRequestOp.Progress;
|
Progress = _webTextRequestOp.Progress;
|
||||||
if (_webTextRequestOp.IsDone == false)
|
if (_webTextRequestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ namespace YooAsset
|
|||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_timeout = timeout;
|
_timeout = timeout;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.RequestPackageVersion;
|
_steps = ESteps.RequestPackageVersion;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
@@ -42,9 +42,11 @@ namespace YooAsset
|
|||||||
string filePath = _fileSystem.GetWebPackageVersionFilePath();
|
string filePath = _fileSystem.GetWebPackageVersionFilePath();
|
||||||
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
||||||
_webTextRequestOp = new UnityWebTextRequestOperation(url, _timeout);
|
_webTextRequestOp = new UnityWebTextRequestOperation(url, _timeout);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _webTextRequestOp);
|
_webTextRequestOp.StartOperation();
|
||||||
|
AddChildOperation(_webTextRequestOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_webTextRequestOp.UpdateOperation();
|
||||||
if (_webTextRequestOp.IsDone == false)
|
if (_webTextRequestOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -56,14 +56,14 @@ namespace YooAsset
|
|||||||
void SetParameter(string name, object value);
|
void SetParameter(string name, object value);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建缓存系统
|
/// 创建文件系统
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void OnCreate(string packageName, string packageRoot);
|
void OnCreate(string packageName, string packageRoot);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 更新文件系统
|
/// 销毁文件系统
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void OnUpdate();
|
void OnDestroy();
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_error = error;
|
_error = error;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(_error))
|
if (string.IsNullOrEmpty(_error))
|
||||||
{
|
{
|
||||||
@@ -29,7 +29,7 @@ namespace YooAsset
|
|||||||
Error = _error;
|
Error = _error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,11 +34,19 @@ namespace YooAsset
|
|||||||
DownloadedBytes = 0;
|
DownloadedBytes = 0;
|
||||||
DownloadProgress = 0;
|
DownloadProgress = 0;
|
||||||
}
|
}
|
||||||
public void Release()
|
|
||||||
|
/// <summary>
|
||||||
|
/// 减少引用计数
|
||||||
|
/// </summary>
|
||||||
|
public virtual void Release()
|
||||||
{
|
{
|
||||||
RefCount--;
|
RefCount--;
|
||||||
}
|
}
|
||||||
public void Reference()
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加引用计数
|
||||||
|
/// </summary>
|
||||||
|
public virtual void Reference()
|
||||||
{
|
{
|
||||||
RefCount++;
|
RefCount++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
internal abstract class FSLoadBundleOperation : AsyncOperationBase
|
internal abstract class FSLoadBundleOperation : AsyncOperationBase
|
||||||
@@ -18,11 +17,6 @@ namespace YooAsset
|
|||||||
/// 下载大小
|
/// 下载大小
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long DownloadedBytes { protected set; get; } = 0;
|
public long DownloadedBytes { protected set; get; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 终止下载任务
|
|
||||||
/// </summary>
|
|
||||||
public abstract void AbortDownloadOperation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal sealed class FSLoadBundleCompleteOperation : FSLoadBundleOperation
|
internal sealed class FSLoadBundleCompleteOperation : FSLoadBundleOperation
|
||||||
@@ -33,15 +27,12 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_error = error;
|
_error = error;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
Status = EOperationStatus.Failed;
|
Status = EOperationStatus.Failed;
|
||||||
Error = _error;
|
Error = _error;
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
|
||||||
}
|
|
||||||
public override void AbortDownloadOperation()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Networking;
|
|
||||||
|
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user