mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-22 08:20:18 +00:00
Update AssetBundleBuilder
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace YooAsset.Editor
|
||||
{
|
||||
@@ -10,40 +11,29 @@ namespace YooAsset.Editor
|
||||
[Serializable]
|
||||
public class BuildReport
|
||||
{
|
||||
/// <summary>
|
||||
/// 构建汇总信息
|
||||
/// </summary>
|
||||
public BuildSummary Summary = new BuildSummary();
|
||||
|
||||
/// <summary>
|
||||
/// 资源包列表
|
||||
/// </summary>
|
||||
public readonly List<BuildBundleInfo> BundleInfos = new List<BuildBundleInfo>(1000);
|
||||
public List<BuildBundleInfo> BundleInfos;
|
||||
|
||||
/// <summary>
|
||||
/// 冗余的资源列表
|
||||
/// </summary>
|
||||
public readonly List<string> RedundancyList = new List<string>(1000);
|
||||
public List<string> RedundancyList;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 检测是否包含BundleName
|
||||
/// 序列化
|
||||
/// </summary>
|
||||
public bool IsContainsBundle(string bundleFullName)
|
||||
public static void Serialize(string savePath, BuildReport buildReport)
|
||||
{
|
||||
return TryGetBundleInfo(bundleFullName, out BuildBundleInfo bundleInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取资源包类,如果没有返回空
|
||||
/// </summary>
|
||||
public bool TryGetBundleInfo(string bundleFullName, out BuildBundleInfo result)
|
||||
{
|
||||
foreach (var bundleInfo in BundleInfos)
|
||||
{
|
||||
if (bundleInfo.BundleName == bundleFullName)
|
||||
{
|
||||
result = bundleInfo;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
result = null;
|
||||
return false;
|
||||
string json = JsonUtility.ToJson(buildReport, true);
|
||||
FileUtility.CreateFile(savePath, json);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using UnityEditor;
|
||||
|
||||
namespace YooAsset.Editor
|
||||
{
|
||||
[Serializable]
|
||||
public class BuildSummary
|
||||
{
|
||||
/// <summary>
|
||||
/// 引擎版本
|
||||
/// </summary>
|
||||
public string UnityVersion;
|
||||
|
||||
/// <summary>
|
||||
/// 构建时间
|
||||
/// </summary>
|
||||
public string BuildTime;
|
||||
|
||||
/// <summary>
|
||||
/// 构建耗时(单位:秒)
|
||||
/// </summary>
|
||||
public int BuildSeconds;
|
||||
|
||||
/// <summary>
|
||||
/// 构建平台
|
||||
/// </summary>
|
||||
public BuildTarget BuildTarget;
|
||||
|
||||
/// <summary>
|
||||
/// 构建版本
|
||||
/// </summary>
|
||||
public int BuildVersion;
|
||||
|
||||
/// <summary>
|
||||
/// 是否开启冗余机制
|
||||
/// </summary>
|
||||
public bool ApplyRedundancy;
|
||||
|
||||
/// <summary>
|
||||
/// 是否开启文件后缀名
|
||||
/// </summary>
|
||||
public bool AppendFileExtension;
|
||||
|
||||
#region 着色器
|
||||
public bool IsCollectAllShaders;
|
||||
public string ShadersBundleName;
|
||||
#endregion
|
||||
|
||||
#region 构建参数
|
||||
public bool IsForceRebuild;
|
||||
public string BuildinTags;
|
||||
public ECompressOption CompressOption;
|
||||
public bool IsAppendHash;
|
||||
public bool IsDisableWriteTypeTree;
|
||||
public bool IsIgnoreTypeTreeChanges;
|
||||
public bool IsDisableLoadAssetByFileName;
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc215f5628022c345be919a0e21fcc8c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user