Ship the WeChat hot-update catalogs and the camp, TideWhale T2, UI atlas, and animation-lab work.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,12 +6,13 @@ using YooAsset.Editor;
|
||||
|
||||
namespace AIGame.EditorTools
|
||||
{
|
||||
/// <summary>把 Candy UI Prefab 收进 Art;图片/字体通过 Prefab 依赖进入资源包。</summary>
|
||||
/// <summary>UI Prefab 与自动图集收进 Art;每个图集与原图绑定为同一资源包。</summary>
|
||||
public static class SetupUiBundleCollector
|
||||
{
|
||||
[MenuItem("Tools/UI/Setup UI Bundle Collector")]
|
||||
public static string Setup()
|
||||
{
|
||||
UiSpriteAtlasGenerator.GenerateAll();
|
||||
var package = BundleCollectorSettingData.Setting.Packages.FirstOrDefault(p => p.PackageName == "Art");
|
||||
if (package == null) throw new System.InvalidOperationException("Set up the Art package before UI collection.");
|
||||
var group = package.Groups.FirstOrDefault(g => g.GroupName == "UI");
|
||||
@@ -36,9 +37,29 @@ namespace AIGame.EditorTools
|
||||
};
|
||||
BundleCollectorSettingData.CreateCollector(group, collector);
|
||||
}
|
||||
ConfigureAtlasCollector(group, HotUpdate.UI.UiAtlasPaths.AtlasRoot,
|
||||
ECollectorType.MainAssetCollector, nameof(CollectUiAtlas), "ui");
|
||||
ConfigureAtlasCollector(group, HotUpdate.UI.UiAtlasPaths.TextureRoot,
|
||||
ECollectorType.DependAssetCollector, nameof(CollectUiAtlasTexture), "");
|
||||
package.CheckConfigError();
|
||||
BundleCollectorSettingData.SaveFile();
|
||||
return "Art/UI collects Candy UI by prefab name, including sprite/font dependencies.";
|
||||
return "Art/UI: UI prefabs by name; generated atlases by name; source sprites in the same bundle as their atlas.";
|
||||
}
|
||||
|
||||
private static void ConfigureAtlasCollector(BundleCollectorGroup group, string path,
|
||||
ECollectorType type, string filter, string tags)
|
||||
{
|
||||
var collector = group.Collectors.FirstOrDefault(c => c.CollectPath == path);
|
||||
bool created = collector == null;
|
||||
if (created) collector = new BundleCollector { CollectPath = path };
|
||||
collector.CollectorGUID = AssetDatabase.AssetPathToGUID(path);
|
||||
collector.CollectorType = type;
|
||||
collector.AddressRuleName = nameof(AddressByFileName);
|
||||
collector.PackRuleName = nameof(PackUiAtlas);
|
||||
collector.FilterRuleName = filter;
|
||||
collector.AssetTags = tags;
|
||||
if (created) BundleCollectorSettingData.CreateCollector(group, collector);
|
||||
else BundleCollectorSettingData.ModifyCollector(group, collector);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user