update editor code

1. IShareAssetPackRule重命名为ISharedPackRule
2. DefaultShareAssetPackRule重命名为DefaultSharedPackRule
pull/122/head
hevinci 2023-06-27 11:00:01 +08:00
parent 0b2a2bf97d
commit 84f9d1985e
12 changed files with 21 additions and 17 deletions

View File

@ -276,7 +276,7 @@ namespace YooAsset.Editor
buildParameters.PackageVersion = _buildVersionField.value;
buildParameters.VerifyBuildingResult = true;
buildParameters.AutoAnalyzeRedundancy = true;
buildParameters.ShareAssetPackRule = new DefaultShareAssetPackRule();
buildParameters.SharedPackRule = new DefaultSharedPackRule();
buildParameters.EncryptionServices = CreateEncryptionServicesInstance();
buildParameters.CompressOption = AssetBundleBuilderSettingData.Setting.CompressOption;
buildParameters.OutputNameStyle = AssetBundleBuilderSettingData.Setting.OutputNameStyle;

View File

@ -164,7 +164,7 @@ namespace YooAsset.Editor
/// <summary>
/// 计算共享资源包的完整包名
/// </summary>
public void CalculateShareBundleName(IShareAssetPackRule packRule, bool uniqueBundleName, string packageName, string shadersBundleName)
public void CalculateShareBundleName(ISharedPackRule packRule, bool uniqueBundleName, string packageName, string shadersBundleName)
{
if (CollectorType != ECollectorType.None)
return;

View File

@ -85,7 +85,7 @@ namespace YooAsset.Editor
/// <summary>
/// 共享资源的打包规则
/// </summary>
public IShareAssetPackRule ShareAssetPackRule = null;
public ISharedPackRule SharedPackRule = null;
/// <summary>
/// 资源的加密接口

View File

@ -79,9 +79,9 @@ namespace YooAsset.Editor
public bool AutoAnalyzeRedundancy;
/// <summary>
/// 共享资源的打包类名
/// 共享资源的打包规则类名
/// </summary>
public string ShareAssetPackRuleClassName;
public string SharedPackRuleClassName;
/// <summary>
/// 加密服务类名称

View File

@ -50,8 +50,8 @@ namespace YooAsset.Editor
buildReport.Summary.IncludeAssetGUID = buildMapContext.Command.IncludeAssetGUID;
buildReport.Summary.UniqueBundleName = buildMapContext.Command.UniqueBundleName;
buildReport.Summary.AutoAnalyzeRedundancy = buildParameters.AutoAnalyzeRedundancy;
buildReport.Summary.ShareAssetPackRuleClassName = buildParameters.ShareAssetPackRule == null ?
"null" : buildParameters.ShareAssetPackRule.GetType().FullName;
buildReport.Summary.SharedPackRuleClassName = buildParameters.SharedPackRule == null ?
"null" : buildParameters.SharedPackRule.GetType().FullName;
buildReport.Summary.EncryptionServicesClassName = buildParameters.EncryptionServices == null ?
"null" : buildParameters.EncryptionServices.GetType().FullName;

View File

@ -26,10 +26,10 @@ namespace YooAsset.Editor
/// </summary>
public BuildMapContext CreateBuildMap(BuildParameters buildParameters)
{
EBuildMode buildMode = buildParameters.BuildMode;
string packageName = buildParameters.PackageName;
IShareAssetPackRule sharePackRule = buildParameters.ShareAssetPackRule;
bool autoAnalyzeRedundancy = buildParameters.AutoAnalyzeRedundancy;
var buildMode = buildParameters.BuildMode;
var packageName = buildParameters.PackageName;
var sharedPackRule = buildParameters.SharedPackRule;
var autoAnalyzeRedundancy = buildParameters.AutoAnalyzeRedundancy;
Dictionary<string, BuildAssetInfo> allBuildAssetInfoDic = new Dictionary<string, BuildAssetInfo>(1000);
@ -106,7 +106,7 @@ namespace YooAsset.Editor
var command = collectResult.Command;
foreach (var buildAssetInfo in allBuildAssetInfoDic.Values)
{
buildAssetInfo.CalculateShareBundleName(sharePackRule, command.UniqueBundleName, command.PackageName, command.ShadersBundleName);
buildAssetInfo.CalculateShareBundleName(sharedPackRule, command.UniqueBundleName, command.PackageName, command.ShadersBundleName);
}
}
else

View File

@ -48,7 +48,7 @@ namespace YooAsset.Editor
}
// 检测共享资源打包规则
if (buildParameters.ShareAssetPackRule == null)
if (buildParameters.SharedPackRule == null)
throw new Exception("共享资源打包规则不能为空!");
#if UNITY_WEBGL

View File

@ -4,7 +4,7 @@ namespace YooAsset.Editor
/// <summary>
/// 共享资源的打包规则
/// </summary>
public interface IShareAssetPackRule
public interface ISharedPackRule
{
/// <summary>
/// 获取打包规则结果

View File

@ -4,7 +4,10 @@ using UnityEditor;
namespace YooAsset.Editor
{
public class DefaultShareAssetPackRule : IShareAssetPackRule
/// <summary>
/// 零冗余共享资源打包规则
/// </summary>
public class DefaultSharedPackRule : ISharedPackRule
{
public PackRuleResult GetPackRuleResult(string assetPath)
{

View File

@ -66,13 +66,14 @@ namespace YooAsset.Editor
_items.Add(new ItemWrapper("包裹名称", buildReport.Summary.BuildPackageName));
_items.Add(new ItemWrapper("包裹版本", buildReport.Summary.BuildPackageVersion));
_items.Add(new ItemWrapper(string.Empty, string.Empty));
_items.Add(new ItemWrapper("启用可寻址资源定位", $"{buildReport.Summary.EnableAddressable}"));
_items.Add(new ItemWrapper("资源定位地址大小写不敏感", $"{buildReport.Summary.LocationToLower}"));
_items.Add(new ItemWrapper("包含资源GUID数据", $"{buildReport.Summary.IncludeAssetGUID}"));
_items.Add(new ItemWrapper("资源包名唯一化", $"{buildReport.Summary.UniqueBundleName}"));
_items.Add(new ItemWrapper("自动分析冗余资源", $"{buildReport.Summary.AutoAnalyzeRedundancy}"));
_items.Add(new ItemWrapper("共享资源的打包类名称", buildReport.Summary.ShareAssetPackRuleClassName));
_items.Add(new ItemWrapper("加密服务类名称", buildReport.Summary.EncryptionServicesClassName));
_items.Add(new ItemWrapper("共享资源打包规则", buildReport.Summary.SharedPackRuleClassName));
_items.Add(new ItemWrapper("资源加密服务类", buildReport.Summary.EncryptionServicesClassName));
_items.Add(new ItemWrapper(string.Empty, string.Empty));
_items.Add(new ItemWrapper("构建参数", string.Empty));