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

Commit b88cde3

Browse files
committed
修改Addressable label为交集获取
1 parent df63895 commit b88cde3

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

GameFramework/Editor/AddressablesEditor/AddressablesEditor.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static string ShellBuild(string activeProfileId = "Default")
3636
@string.AppendLine(item.address);
3737
}
3838
//将被修改过的资源单独分组
39-
var groupName = string.Format("UpdateGroup_{0}_", System.DateTime.Now.ToString("yyyyMMdd"));
39+
var groupName = string.Format("UpdateGroup_{0}#", System.DateTime.Now.ToString("yyyyMMdd"));
4040
ContentUpdateScript.CreateContentUpdateGroup(settings, entries, groupName);
4141
Debug.Log($"Update content:{@string}");
4242
AssetDatabase.Refresh();
@@ -57,8 +57,19 @@ public static string ShellBuild(string activeProfileId = "Default")
5757
return settings.RemoteCatalogBuildPath.GetValue(settings);
5858

5959
return "";
60+
}
6061

62+
public static void ShellBuildPlayerContent(string activeProfileId = "Default")
63+
{
64+
var settings = AddressableAssetSettingsDefaultObject.Settings;
65+
if (settings != null && settings.BuildRemoteCatalog)
66+
{
67+
var profileId = settings.profileSettings.GetProfileId(activeProfileId);
68+
settings.activeProfileId = profileId;
69+
}
70+
AddressableAssetSettings.BuildPlayerContent();
71+
AssetDatabase.Refresh();
6172
}
62-
73+
6374
}
6475
}

GameFramework/Runtime/Resource/AddressablesAssetsHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public T[] FindAssets<T>(List<string> tags) where T : UnityEngine.Object
5454
{
5555
var handle= Addressables.LoadAssetsAsync<T>(tags, (tObject) =>
5656
{
57-
},Addressables.MergeMode.Intersection);
57+
},Addressables.MergeMode.Union);
5858

5959
var resultList= handle.WaitForCompletion();
6060
T[] result = new T[resultList.Count];
@@ -66,7 +66,7 @@ public void FindAssets<T>(List<string> tags, Action<T[]> callback) where T : Uni
6666
{
6767
var handle = Addressables.LoadAssetsAsync<T>(tags, (tObject) =>
6868
{
69-
}, Addressables.MergeMode.Intersection);
69+
}, Addressables.MergeMode.Union);
7070

7171
handle.Completed += (resultHandle) => {
7272
var resultList = resultHandle.Result;

GameFramework/Runtime/UI/UIManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,11 @@ private UIView GetUIView(IUIContext uiContext)
314314
GameObject uiViewClone = GameObject.Instantiate(uiViewSource, _uiViewParent);
315315
uiView = uiViewClone.GetComponent<UIView>();
316316
if (uiView == null)
317+
{
318+
MonoBehaviour.Destroy(uiViewClone);
317319
return null;
320+
}
321+
uiViewClone.layer = LayerMask.NameToLayer("UI");
318322
_allUIView[uiContext] = uiView;
319323
uiView.OnInit(uiContext);
320324
loadTime = Time.realtimeSinceStartup- loadTime;

0 commit comments

Comments
 (0)