update resource package

增加新方法:public PackageDetails GetPackageDetails()
dev
何冠峰 2024-12-19 17:25:31 +08:00
parent 36f561a595
commit 16344393a1
4 changed files with 103 additions and 2 deletions

View File

@ -0,0 +1,61 @@

namespace YooAsset
{
public class PackageDetails
{
/// <summary>
/// 文件版本
/// </summary>
public string FileVersion;
/// <summary>
/// 启用可寻址资源定位
/// </summary>
public bool EnableAddressable;
/// <summary>
/// 资源定位地址大小写不敏感
/// </summary>
public bool LocationToLower;
/// <summary>
/// 包含资源GUID数据
/// </summary>
public bool IncludeAssetGUID;
/// <summary>
/// 文件名称样式
/// </summary>
public int OutputNameStyle;
/// <summary>
/// 构建管线名称
/// </summary>
public string BuildPipeline;
/// <summary>
/// 资源包裹名称
/// </summary>
public string PackageName;
/// <summary>
/// 资源包裹的版本信息
/// </summary>
public string PackageVersion;
/// <summary>
/// 资源包裹的备注信息
/// </summary>
public string PackageNote;
/// <summary>
/// 主资源文件总数
/// </summary>
public int AssetTotalCount;
/// <summary>
/// 资源包文件总数
/// </summary>
public int BundleTotalCount;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 931f6c93109389b4f8fd4d48857d082b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -105,6 +105,26 @@ namespace YooAsset
public Dictionary<string, string> AssetPathMapping2;
/// <summary>
/// 获取包裹的详细信息
/// </summary>
public PackageDetails GetPackageDetails()
{
PackageDetails details = new PackageDetails();
details.FileVersion = FileVersion;
details.EnableAddressable = EnableAddressable;
details.LocationToLower = LocationToLower;
details.IncludeAssetGUID = IncludeAssetGUID;
details.OutputNameStyle = OutputNameStyle;
details.BuildPipeline = BuildPipeline;
details.PackageName = PackageName;
details.PackageVersion = PackageVersion;
details.PackageNote = PackageNote;
details.AssetTotalCount = AssetList.Count;
details.BundleTotalCount = BundleList.Count;
return details;
}
/// <summary>
/// 尝试映射为资源路径
/// </summary>

View File

@ -258,7 +258,7 @@ namespace YooAsset
}
/// <summary>
/// 获取本地包裹的版本信息
/// 获取当前激活包裹的版本信息
/// </summary>
public string GetPackageVersion()
{
@ -267,7 +267,7 @@ namespace YooAsset
}
/// <summary>
/// 获取本地包裹的备注信息
/// 获取当前激活包裹的备注信息
/// </summary>
public string GetPackageNote()
{
@ -275,6 +275,15 @@ namespace YooAsset
return _playModeImpl.ActiveManifest.PackageNote;
}
/// <summary>
/// 获取当前激活包裹的详细信息
/// </summary>
public PackageDetails GetPackageDetails()
{
DebugCheckInitialize();
return _playModeImpl.ActiveManifest.GetPackageDetails();
}
#region 资源回收
/// <summary>
/// 强制回收所有资源