Update AssetBundleBuilder
parent
b8e2f33137
commit
c454cbdfb8
|
@ -38,11 +38,6 @@ namespace YooAsset.Editor
|
|||
private string[] _encryptionServicesClassNames;
|
||||
private int _encryptionServicesSelectIndex = -1;
|
||||
|
||||
// 冗余类相关
|
||||
private List<Type> _redundancyServicesClassTypes;
|
||||
private string[] _redundancyServicesClassNames;
|
||||
private int _redundancyServicesSelectIndex = -1;
|
||||
|
||||
// GUI相关
|
||||
private bool _isInit = false;
|
||||
private GUIStyle _centerStyle;
|
||||
|
@ -67,8 +62,6 @@ namespace YooAsset.Editor
|
|||
_compressOption = (ECompressOption)EditorGUILayout.EnumPopup("Compression", _compressOption, GUILayout.MaxWidth(300));
|
||||
if (_encryptionServicesClassNames.Length > 0)
|
||||
_encryptionServicesSelectIndex = EditorGUILayout.Popup("Encryption Services", _encryptionServicesSelectIndex, _encryptionServicesClassNames, GUILayout.MaxWidth(300));
|
||||
if (_redundancyServicesClassNames.Length > 0)
|
||||
_redundancyServicesSelectIndex = EditorGUILayout.Popup("Redundancy Services", _redundancyServicesSelectIndex, _redundancyServicesClassNames, GUILayout.MaxWidth(300));
|
||||
_appendExtension = GUILayout.Toggle(_appendExtension, "Append Extension", GUILayout.MaxWidth(120));
|
||||
_forceRebuild = GUILayout.Toggle(_forceRebuild, "Force Rebuild", GUILayout.MaxWidth(120));
|
||||
if (_forceRebuild)
|
||||
|
@ -122,9 +115,6 @@ namespace YooAsset.Editor
|
|||
_encryptionServicesClassTypes = GetEncryptionServicesClassTypes();
|
||||
_encryptionServicesClassNames = _encryptionServicesClassTypes.Select(t => t.FullName).ToArray();
|
||||
|
||||
_redundancyServicesClassTypes = GetRedundancyServicesClassTypes();
|
||||
_redundancyServicesClassNames = _redundancyServicesClassTypes.Select(t => t.FullName).ToArray();
|
||||
|
||||
// 读取配置
|
||||
LoadSettingsFromPlayerPrefs();
|
||||
}
|
||||
|
@ -143,7 +133,6 @@ namespace YooAsset.Editor
|
|||
buildParameters.CompressOption = _compressOption;
|
||||
buildParameters.AppendFileExtension = _appendExtension;
|
||||
buildParameters.EncryptionServices = CreateEncryptionServicesInstance();
|
||||
buildParameters.RedundancyServices = CreateRedundancyServicesInstance();
|
||||
buildParameters.ForceRebuild = _forceRebuild;
|
||||
buildParameters.BuildinTags = _buildinTags;
|
||||
_assetBuilder.Run(buildParameters);
|
||||
|
@ -162,19 +151,6 @@ namespace YooAsset.Editor
|
|||
return (IEncryptionServices)Activator.CreateInstance(classType);
|
||||
}
|
||||
|
||||
private List<Type> GetRedundancyServicesClassTypes()
|
||||
{
|
||||
List<Type> classTypes = AssemblyUtility.GetAssignableTypes(AssemblyUtility.UnityDefaultAssemblyEditorName, typeof(IRedundancyServices));
|
||||
return classTypes;
|
||||
}
|
||||
private IRedundancyServices CreateRedundancyServicesInstance()
|
||||
{
|
||||
if (_redundancyServicesSelectIndex < 0)
|
||||
return null;
|
||||
var classType = _redundancyServicesClassTypes[_redundancyServicesSelectIndex];
|
||||
return (IRedundancyServices)Activator.CreateInstance(classType);
|
||||
}
|
||||
|
||||
#region 配置相关
|
||||
private const string StrEditorCompressOption = "StrEditorCompressOption";
|
||||
private const string StrEditorAppendExtension = "StrEditorAppendExtension";
|
||||
|
|
|
@ -45,11 +45,6 @@ namespace YooAsset.Editor
|
|||
/// </summary>
|
||||
public IEncryptionServices EncryptionServices;
|
||||
|
||||
/// <summary>
|
||||
/// 冗余类
|
||||
/// </summary>
|
||||
public IRedundancyServices RedundancyServices;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 强制重新构建整个项目,如果为FALSE则是增量打包
|
||||
|
|
|
@ -58,11 +58,6 @@ namespace YooAsset.Editor
|
|||
/// </summary>
|
||||
public string EncryptionServicesClassName;
|
||||
|
||||
/// <summary>
|
||||
/// 冗余服务类名称
|
||||
/// </summary>
|
||||
public string RedundancyServicesClassName;
|
||||
|
||||
// 构建参数
|
||||
public bool ForceRebuild;
|
||||
public string BuildinTags;
|
||||
|
|
|
@ -35,8 +35,6 @@ namespace YooAsset.Editor
|
|||
buildReport.Summary.ShadersBundleName = AssetBundleGrouperSettingData.Setting.ShadersBundleName;
|
||||
buildReport.Summary.EncryptionServicesClassName = buildParameters.Parameters.EncryptionServices == null ?
|
||||
"null" : buildParameters.Parameters.EncryptionServices.GetType().FullName;
|
||||
buildReport.Summary.RedundancyServicesClassName = buildParameters.Parameters.RedundancyServices == null ?
|
||||
"null" : buildParameters.Parameters.RedundancyServices.GetType().FullName;
|
||||
|
||||
// 构建参数
|
||||
buildReport.Summary.ForceRebuild = buildParameters.Parameters.ForceRebuild;
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
|
||||
namespace YooAsset.Editor
|
||||
{
|
||||
public interface IRedundancyServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 检测是否冗余
|
||||
/// </summary>
|
||||
bool Check(string filePath);
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d211989e17a617741a1963b8523fe9c7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue