Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit 8e20758

Browse files
author
zhangyang
committed
资源管理增加可自动处理的插件接口
1 parent 349ec93 commit 8e20758

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

GameFramework/Editor/AssetManagement/AddressablesEditor.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ namespace Wanderer.GameFramework
1414
{
1515
public class AddressablesEditor
1616
{
17+
//资源管理插件
18+
public static IAssetGroupPlugin AssetGroupPlugin;
19+
1720
public static string ShellBuild(string activeProfileId = "Default")
1821
{
1922
bool buildPlayerContent = true;
@@ -37,7 +40,7 @@ public static string ShellBuild(string activeProfileId = "Default")
3740
{
3841
@string.AppendLine(item.address);
3942
}
40-
//将被修改过的资源单独分组
43+
//�����޸Ĺ�����Դ��������
4144
var groupName = string.Format("UpdateGroup_{0}#", System.DateTime.Now.ToString("yyyyMMdd"));
4245
ContentUpdateScript.CreateContentUpdateGroup(settings, entries, groupName);
4346
var group= settings.FindGroup(groupName);
@@ -97,11 +100,17 @@ public static void ShellBuildPlayerContent(string activeProfileId = "Default")
97100
}
98101

99102
/// <summary>
100-
/// 设置Addressable的所有资源
103+
/// ����Addressable��������Դ
101104
/// </summary>
102105
[MenuItem("Tools/Asset Management/Assets To Addressables")]
103106
public static void SetAddressablesAssets()
104107
{
108+
if(AssetGroupPlugin!=null)
109+
{
110+
AssetGroupPlugin.MakeAssetGroup();
111+
AssetDatabase.Refresh();
112+
}
113+
105114
JsonData config = ProjectSettingsConfig.LoadJsonData(AssetGroupEditor.ConfigName);
106115
var settings = AddressableAssetSettingsDefaultObject.Settings;
107116
if (settings != null)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Wanderer.GameFramework
2+
{
3+
public interface IAssetGroupPlugin
4+
{
5+
void MakeAssetGroup();
6+
}
7+
}

GameFramework/Editor/AssetManagement/IAssetGroupPlugin.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)