update editor code
1. IShareAssetPackRule重命名为ISharedPackRule 2. DefaultShareAssetPackRule重命名为DefaultSharedPackRulemlyDevMerge1.5.7
parent
12b7cff482
commit
c289abb262
|
@ -276,7 +276,7 @@ namespace YooAsset.Editor
|
||||||
buildParameters.PackageVersion = _buildVersionField.value;
|
buildParameters.PackageVersion = _buildVersionField.value;
|
||||||
buildParameters.VerifyBuildingResult = true;
|
buildParameters.VerifyBuildingResult = true;
|
||||||
buildParameters.AutoAnalyzeRedundancy = true;
|
buildParameters.AutoAnalyzeRedundancy = true;
|
||||||
buildParameters.ShareAssetPackRule = new DefaultShareAssetPackRule();
|
buildParameters.SharedPackRule = new DefaultSharedPackRule();
|
||||||
buildParameters.EncryptionServices = CreateEncryptionServicesInstance();
|
buildParameters.EncryptionServices = CreateEncryptionServicesInstance();
|
||||||
buildParameters.CompressOption = AssetBundleBuilderSettingData.Setting.CompressOption;
|
buildParameters.CompressOption = AssetBundleBuilderSettingData.Setting.CompressOption;
|
||||||
buildParameters.OutputNameStyle = AssetBundleBuilderSettingData.Setting.OutputNameStyle;
|
buildParameters.OutputNameStyle = AssetBundleBuilderSettingData.Setting.OutputNameStyle;
|
||||||
|
|
|
@ -164,7 +164,7 @@ namespace YooAsset.Editor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计算共享资源包的完整包名
|
/// 计算共享资源包的完整包名
|
||||||
/// </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)
|
if (CollectorType != ECollectorType.None)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -85,7 +85,7 @@ namespace YooAsset.Editor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 共享资源的打包规则
|
/// 共享资源的打包规则
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IShareAssetPackRule ShareAssetPackRule = null;
|
public ISharedPackRule SharedPackRule = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源的加密接口
|
/// 资源的加密接口
|
||||||
|
|
|
@ -79,9 +79,9 @@ namespace YooAsset.Editor
|
||||||
public bool AutoAnalyzeRedundancy;
|
public bool AutoAnalyzeRedundancy;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 共享资源的打包类名称
|
/// 共享资源的打包规则类名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ShareAssetPackRuleClassName;
|
public string SharedPackRuleClassName;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加密服务类名称
|
/// 加密服务类名称
|
||||||
|
|
|
@ -50,8 +50,8 @@ namespace YooAsset.Editor
|
||||||
buildReport.Summary.IncludeAssetGUID = buildMapContext.Command.IncludeAssetGUID;
|
buildReport.Summary.IncludeAssetGUID = buildMapContext.Command.IncludeAssetGUID;
|
||||||
buildReport.Summary.UniqueBundleName = buildMapContext.Command.UniqueBundleName;
|
buildReport.Summary.UniqueBundleName = buildMapContext.Command.UniqueBundleName;
|
||||||
buildReport.Summary.AutoAnalyzeRedundancy = buildParameters.AutoAnalyzeRedundancy;
|
buildReport.Summary.AutoAnalyzeRedundancy = buildParameters.AutoAnalyzeRedundancy;
|
||||||
buildReport.Summary.ShareAssetPackRuleClassName = buildParameters.ShareAssetPackRule == null ?
|
buildReport.Summary.SharedPackRuleClassName = buildParameters.SharedPackRule == null ?
|
||||||
"null" : buildParameters.ShareAssetPackRule.GetType().FullName;
|
"null" : buildParameters.SharedPackRule.GetType().FullName;
|
||||||
buildReport.Summary.EncryptionServicesClassName = buildParameters.EncryptionServices == null ?
|
buildReport.Summary.EncryptionServicesClassName = buildParameters.EncryptionServices == null ?
|
||||||
"null" : buildParameters.EncryptionServices.GetType().FullName;
|
"null" : buildParameters.EncryptionServices.GetType().FullName;
|
||||||
|
|
||||||
|
|
|
@ -26,10 +26,10 @@ namespace YooAsset.Editor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public BuildMapContext CreateBuildMap(BuildParameters buildParameters)
|
public BuildMapContext CreateBuildMap(BuildParameters buildParameters)
|
||||||
{
|
{
|
||||||
EBuildMode buildMode = buildParameters.BuildMode;
|
var buildMode = buildParameters.BuildMode;
|
||||||
string packageName = buildParameters.PackageName;
|
var packageName = buildParameters.PackageName;
|
||||||
IShareAssetPackRule sharePackRule = buildParameters.ShareAssetPackRule;
|
var sharedPackRule = buildParameters.SharedPackRule;
|
||||||
bool autoAnalyzeRedundancy = buildParameters.AutoAnalyzeRedundancy;
|
var autoAnalyzeRedundancy = buildParameters.AutoAnalyzeRedundancy;
|
||||||
|
|
||||||
Dictionary<string, BuildAssetInfo> allBuildAssetInfoDic = new Dictionary<string, BuildAssetInfo>(1000);
|
Dictionary<string, BuildAssetInfo> allBuildAssetInfoDic = new Dictionary<string, BuildAssetInfo>(1000);
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ namespace YooAsset.Editor
|
||||||
var command = collectResult.Command;
|
var command = collectResult.Command;
|
||||||
foreach (var buildAssetInfo in allBuildAssetInfoDic.Values)
|
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
|
else
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace YooAsset.Editor
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检测共享资源打包规则
|
// 检测共享资源打包规则
|
||||||
if (buildParameters.ShareAssetPackRule == null)
|
if (buildParameters.SharedPackRule == null)
|
||||||
throw new Exception("共享资源打包规则不能为空!");
|
throw new Exception("共享资源打包规则不能为空!");
|
||||||
|
|
||||||
#if UNITY_WEBGL
|
#if UNITY_WEBGL
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace YooAsset.Editor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 共享资源的打包规则
|
/// 共享资源的打包规则
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IShareAssetPackRule
|
public interface ISharedPackRule
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取打包规则结果
|
/// 获取打包规则结果
|
|
@ -4,7 +4,10 @@ using UnityEditor;
|
||||||
|
|
||||||
namespace YooAsset.Editor
|
namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
public class DefaultShareAssetPackRule : IShareAssetPackRule
|
/// <summary>
|
||||||
|
/// 零冗余共享资源打包规则
|
||||||
|
/// </summary>
|
||||||
|
public class DefaultSharedPackRule : ISharedPackRule
|
||||||
{
|
{
|
||||||
public PackRuleResult GetPackRuleResult(string assetPath)
|
public PackRuleResult GetPackRuleResult(string assetPath)
|
||||||
{
|
{
|
|
@ -66,13 +66,14 @@ namespace YooAsset.Editor
|
||||||
_items.Add(new ItemWrapper("包裹名称", buildReport.Summary.BuildPackageName));
|
_items.Add(new ItemWrapper("包裹名称", buildReport.Summary.BuildPackageName));
|
||||||
_items.Add(new ItemWrapper("包裹版本", buildReport.Summary.BuildPackageVersion));
|
_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.EnableAddressable}"));
|
||||||
_items.Add(new ItemWrapper("资源定位地址大小写不敏感", $"{buildReport.Summary.LocationToLower}"));
|
_items.Add(new ItemWrapper("资源定位地址大小写不敏感", $"{buildReport.Summary.LocationToLower}"));
|
||||||
_items.Add(new ItemWrapper("包含资源GUID数据", $"{buildReport.Summary.IncludeAssetGUID}"));
|
_items.Add(new ItemWrapper("包含资源GUID数据", $"{buildReport.Summary.IncludeAssetGUID}"));
|
||||||
_items.Add(new ItemWrapper("资源包名唯一化", $"{buildReport.Summary.UniqueBundleName}"));
|
_items.Add(new ItemWrapper("资源包名唯一化", $"{buildReport.Summary.UniqueBundleName}"));
|
||||||
_items.Add(new ItemWrapper("自动分析冗余资源", $"{buildReport.Summary.AutoAnalyzeRedundancy}"));
|
_items.Add(new ItemWrapper("自动分析冗余资源", $"{buildReport.Summary.AutoAnalyzeRedundancy}"));
|
||||||
_items.Add(new ItemWrapper("共享资源的打包类名称", buildReport.Summary.ShareAssetPackRuleClassName));
|
_items.Add(new ItemWrapper("共享资源打包规则", buildReport.Summary.SharedPackRuleClassName));
|
||||||
_items.Add(new ItemWrapper("加密服务类名称", buildReport.Summary.EncryptionServicesClassName));
|
_items.Add(new ItemWrapper("资源加密服务类", buildReport.Summary.EncryptionServicesClassName));
|
||||||
|
|
||||||
_items.Add(new ItemWrapper(string.Empty, string.Empty));
|
_items.Add(new ItemWrapper(string.Empty, string.Empty));
|
||||||
_items.Add(new ItemWrapper("构建参数", string.Empty));
|
_items.Add(new ItemWrapper("构建参数", string.Empty));
|
||||||
|
|
Loading…
Reference in New Issue