Update AssetBundleBuilder
parent
feb9a22083
commit
7cb0394785
|
@ -4,21 +4,17 @@ using System.Collections.Generic;
|
||||||
|
|
||||||
namespace YooAsset.Editor
|
namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 构建的资源信息类
|
|
||||||
/// </summary>
|
|
||||||
[Serializable]
|
|
||||||
public class BuildAssetInfo
|
public class BuildAssetInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源路径
|
/// 资源路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string AssetPath;
|
public string AssetPath { private set; get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源包完整名称
|
/// 资源包完整名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BundleName;
|
public string BundleName { private set; get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否为原生资源
|
/// 是否为原生资源
|
||||||
|
@ -30,21 +26,21 @@ namespace YooAsset.Editor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsCollectAsset = false;
|
public bool IsCollectAsset = false;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 资源标记列表
|
|
||||||
/// </summary>
|
|
||||||
public List<string> AssetTags = new List<string>();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 被依赖次数
|
/// 被依赖次数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int DependCount = 0;
|
public int DependCount = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 资源标记列表
|
||||||
|
/// </summary>
|
||||||
|
public readonly List<string> AssetTags = new List<string>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 依赖的所有资源
|
/// 依赖的所有资源
|
||||||
/// 注意:包括零依赖资源和冗余资源(资源包名无效)
|
/// 注意:包括零依赖资源和冗余资源(资源包名无效)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<BuildAssetInfo> AllDependAssetInfos;
|
public List<BuildAssetInfo> AllDependAssetInfos { private set; get; }
|
||||||
|
|
||||||
|
|
||||||
public BuildAssetInfo(string assetPath)
|
public BuildAssetInfo(string assetPath)
|
||||||
|
@ -81,10 +77,18 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
foreach (var tag in tags)
|
foreach (var tag in tags)
|
||||||
{
|
{
|
||||||
if (AssetTags.Contains(tag) == false)
|
AddAssetTag(tag);
|
||||||
{
|
}
|
||||||
AssetTags.Add(tag);
|
}
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加资源标记
|
||||||
|
/// </summary>
|
||||||
|
public void AddAssetTag(string tag)
|
||||||
|
{
|
||||||
|
if (AssetTags.Contains(tag) == false)
|
||||||
|
{
|
||||||
|
AssetTags.Add(tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,21 +6,17 @@ using UnityEditor;
|
||||||
|
|
||||||
namespace YooAsset.Editor
|
namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 构建的资源包信息类
|
|
||||||
/// </summary>
|
|
||||||
[Serializable]
|
|
||||||
public class BuildBundleInfo
|
public class BuildBundleInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源包完整名称
|
/// 资源包完整名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BundleName;
|
public string BundleName { private set; get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 包含的资源列表
|
/// 包含的资源列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<BuildAssetInfo> Assets = new List<BuildAssetInfo>();
|
public readonly List<BuildAssetInfo> Assets = new List<BuildAssetInfo>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否为原生文件
|
/// 是否为原生文件
|
|
@ -19,7 +19,7 @@ namespace YooAsset.Editor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源包列表
|
/// 资源包列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<BuildBundleInfo> BundleInfos;
|
public List<ReportBundleInfo> BundleInfos;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 冗余的资源列表
|
/// 冗余的资源列表
|
||||||
|
@ -35,5 +35,14 @@ namespace YooAsset.Editor
|
||||||
string json = JsonUtility.ToJson(buildReport, true);
|
string json = JsonUtility.ToJson(buildReport, true);
|
||||||
FileUtility.CreateFile(savePath, json);
|
FileUtility.CreateFile(savePath, json);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 反序列化
|
||||||
|
/// </summary>
|
||||||
|
public static BuildReport Deserialize(string jsonData)
|
||||||
|
{
|
||||||
|
BuildReport report = JsonUtility.FromJson<BuildReport>(jsonData);
|
||||||
|
return report;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace YooAsset.Editor
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public class ReportAssetInfo
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3ef16d696d8ffbd488c27e539f1966ad
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,12 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace YooAsset.Editor
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public class ReportBundleInfo
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 26aa55851e9252b4ab0655ee60526cb0
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -41,7 +41,7 @@ namespace YooAsset.Editor
|
||||||
buildReport.Summary.IsIgnoreTypeTreeChanges = buildParameters.Parameters.IsIgnoreTypeTreeChanges;
|
buildReport.Summary.IsIgnoreTypeTreeChanges = buildParameters.Parameters.IsIgnoreTypeTreeChanges;
|
||||||
buildReport.Summary.IsDisableLoadAssetByFileName = buildParameters.Parameters.IsDisableLoadAssetByFileName;
|
buildReport.Summary.IsDisableLoadAssetByFileName = buildParameters.Parameters.IsDisableLoadAssetByFileName;
|
||||||
|
|
||||||
buildReport.BundleInfos = buildMapContext.BundleInfos;
|
//buildReport.BundleInfos = buildMapContext.BundleInfos;
|
||||||
buildReport.RedundancyList = buildMapContext.RedundancyList;
|
buildReport.RedundancyList = buildMapContext.RedundancyList;
|
||||||
|
|
||||||
// 删除旧文件
|
// 删除旧文件
|
||||||
|
|
Loading…
Reference in New Issue