Skip to content

Commit caf7dd8

Browse files
author
Unity Technologies
committed
com.unity.addressables@2.7.4
## [2.7.4] - 2025-10-06 - Fixed an issue where having an empty custom load or build path in the inspector would spam the console. - Fixed a faulty Inspector refresh mechanism when creating new addressables group from a template.
1 parent f8ee7c9 commit caf7dd8

15 files changed

+99
-24
lines changed

.attestation.p7m

0 Bytes
Binary file not shown.

.signature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"timestamp":1758121949,"signature":"MlZVVhsJ8ZPaqDiMC+Va/avVqijzkHk8EvmKRMbrM3vlISktzLin30mtVljSqrxpi7rQfZlSRmqvVRnVDvaGOyENT+rS6+wCUvL7K5MIbqzrbFsiQfJvNli8F41iPob7qNsFSCMqo7OHk3EIbQ1AmxG4YOBw8BxjC4hx/ohghCz08vy1mjVjRNVaO8ilOuqMF9l8OsddMqrj2O3Yr0tQilglVx9nfYFlXMnOuHM89dCfrikKKryiM/JgkgrSdVHXY7e1jX58BuZHaHIsB/A4WOTOurboOuDhjJo/+Efu8miNgDOXmUgeW8tUYxGzt+0fTQk+YETKkbOjgbHfEJEPB5v2g7K2Fn6ebCenaxKY9OTmJK2xmS/j3Oj9aS2w4dUs/GGkPNN9pqgwI5HVo5gtUtyIyAp80MGFBi3Xb9/4+2o/RgmY3i5u9UW7H47pBbVl2E517BxBQiCW/m05P+qHbVP+sFsEtsUvjsYiwDgiZT6NT5/tq/HmGYTLR51ZPTDV","publicKey":"LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQm9qQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FZOEFNSUlCaWdLQ0FZRUFzdUhXYUhsZ0I1cVF4ZEJjTlJKSAordHR4SmoxcVY1NTdvMlZaRE1XaXhYRVBkRTBEMVFkT1JIRXNSS1RscmplUXlERU83ZlNQS0ZwZ1A3MU5TTnJCCkFHM2NFSU45aHNQVDhOVmllZmdWem5QTkVMenFkVmdEbFhpb2VpUnV6OER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1VvOOVkElHWJrUm8qxjUXz5j","publicKey":"LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQm9qQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FZOEFNSUlCaWdLQ0FZRUFzdUhXYUhsZ0I1cVF4ZEJjTlJKSAordHR4SmoxcVY1NTdvMlZaRE1XaXhYRVBkRTBEMVFkT1JIRXNSS1RscmplUXlERU83ZlNQS0ZwZ1A3MU5TTnJCCkFHM2NFSU45aHNQVDhOVmllZmdWem5QTkVMenFkVmdEbFhpb2VpUnV6OERKWFgvblpmU1JWKytwbk9ySTRibG4KS0twelJlNW14OTc1SjhxZ1FvRktKT0NNRlpHdkJMR2MxSzZZaEIzOHJFODZCZzgzbUovWjBEYkVmQjBxZm13cgo2ZDVFUXFsd0E5Y3JZT1YyV1VpWXprSnBLNmJZNzRZNmM1TmpBcEFKeGNiaTFOaDlRVEhUcU44N0ZtMDF0R1ZwCjVNd1pXSWZuYVRUemEvTGZLelR5U0pka0tldEZMVGdkYXpMYlpzUEE2aHBSK0FJRTJhc0tLTi84UUk1N3UzU2cKL2xyMnZKS1IvU2l5eEN1Q20vQWJkYnJMbXk0WjlSdm1jMGdpclA4T0lLQWxBRWZ2TzV5Z2hSKy8vd1RpTFlzUQp1SllDM0V2UE16ZGdKUzdGR2FscnFLZzlPTCsxVzROY05yNWdveVdSUUJ0cktKaWlTZEJVWmVxb0RvSUY5NHpCCndGbzJJT1JFdXFqcU51M3diMWZIM3p1dGdtalFra3IxVjJhd3hmcExLWlROQWdNQkFBRT0KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg"}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this package will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6+
## [2.7.4] - 2025-10-06
7+
- Fixed an issue where having an empty custom load or build path in the inspector would spam the console.
8+
- Fixed a faulty Inspector refresh mechanism when creating new addressables group from a template.
9+
610
## [2.7.3] - 2025-09-15
711
- Changed Label window to have consistent Rename UX with the rest of the Editor. You can now press Enter (macOS) or F2 to enter rename, as well as clicking after selecting an item in the list.
812
- Added documentation to mention the fact that loading AssetBundles directly via LoadAssetAsync does not handle dependencies.

Editor/Build/DataBuilders/BuildScriptBase.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,17 @@ protected virtual string ProcessAllGroups(AddressableAssetsBuildContext aaContex
186186
return string.Empty;
187187
}
188188

189+
// If user has recently customized the build/load path in the inspector, it may not be retrievable from profileSettings yet
190+
// We retrieve it directly from the build/load path variable in that case.
191+
internal static string GetCustomOrDefaultPath(AddressableAssetSettings settings, ProfileValueReference pathValueReference, bool useCustomPaths)
192+
{
193+
if (useCustomPaths)
194+
{
195+
return pathValueReference.GetValue(settings, false);
196+
}
197+
198+
return settings.profileSettings.GetValueById(settings.activeProfileId, pathValueReference.Id);
199+
}
189200

190201
internal static string ErrorCheckBundleSettings(AddressableAssetGroup assetGroup, AddressableAssetsBuildContext aaContext)
191202
{
@@ -196,14 +207,14 @@ internal static string ErrorCheckBundleSettings(AddressableAssetGroup assetGroup
196207
var settings = aaContext.Settings;
197208
var schema = assetGroup.GetSchema<BundledAssetGroupSchema>();
198209

199-
if(settings.UseUnityWebRequestForLocalBundles && schema.StripDownloadOptions)
210+
if (settings.UseUnityWebRequestForLocalBundles && schema.StripDownloadOptions)
200211
{
201212
message = "Strip Download Options is enabled, but Use UnityWebRequest for Local Bundles is also enabled. " +
202213
"These options are mutually exclusive and cannot be used together.";
203214
}
204215

205-
string buildPath = settings.profileSettings.GetValueById(settings.activeProfileId, schema.BuildPath.Id);
206-
string loadPath = settings.profileSettings.GetValueById(settings.activeProfileId, schema.LoadPath.Id);
216+
string buildPath = GetCustomOrDefaultPath(settings, schema.BuildPath, schema.m_UseCustomPaths);
217+
string loadPath = GetCustomOrDefaultPath(settings, schema.LoadPath, schema.m_UseCustomPaths);
207218

208219
bool buildLocal = AddressableAssetUtility.StringContains(buildPath, "[UnityEngine.AddressableAssets.Addressables.BuildPath]", StringComparison.Ordinal);
209220
bool loadLocal = AddressableAssetUtility.StringContains(loadPath, "{UnityEngine.AddressableAssets.Addressables.RuntimePath}", StringComparison.Ordinal);

Editor/Build/DataBuilders/BuildScriptPackedMode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ static string[] CreateRemoteCatalog(byte[] data, List<ResourceLocationData> loca
668668
remoteHashLoadLocation.Data = catalogLoadOptions.Copy();
669669
locations.Add(remoteHashLoadLocation);
670670

671-
#if UNITY_SWITCH
671+
#if UNITY_SWITCH || UNITY_SWITCH2
672672
var cacheLoadPath = remoteHashLoadPath; // ResourceLocationBase does not allow empty string id
673673
#else
674674
var cacheLoadPath = "{UnityEngine.Application.persistentDataPath}/com.unity.addressables" + versionedFileName + ".hash";
@@ -919,7 +919,7 @@ static string[] CreateRemoteCatalog(string jsonText, List<ResourceLocationData>
919919
remoteHashLoadLocation.Data = catalogLoadOptions.Copy();
920920
locations.Add(remoteHashLoadLocation);
921921

922-
#if UNITY_SWITCH
922+
#if UNITY_SWITCH || UNITY_SWITCH2
923923
var cacheLoadPath = remoteHashLoadPath; // ResourceLocationBase does not allow empty string id
924924
#else
925925
var cacheLoadPath = "{UnityEngine.Application.persistentDataPath}/com.unity.addressables" + versionedFileName + ".hash";

Editor/GUI/AddressableAssetSettingsInspector.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,8 +1028,8 @@ void DrawRemoteCatalogPaths()
10281028
if (m_ShowPaths)
10291029
{
10301030
EditorStyles.helpBox.fontSize = 12;
1031-
var baseBuildPathValue = BuildPath.GetValue(settings, false);
1032-
var baseLoadPathValue = LoadPath.GetValue(settings, false);
1031+
var baseBuildPathValue = !string.IsNullOrEmpty(BuildPath.Id) ? BuildPath.GetValue(settings, false) : "";
1032+
var baseLoadPathValue = !string.IsNullOrEmpty(LoadPath.Id) ? LoadPath.GetValue(settings, false) : "";
10331033
EditorGUILayout.HelpBox(String.Format("Build Path: {0}", settings.profileSettings.EvaluateString(settings.activeProfileId, baseBuildPathValue)), MessageType.None);
10341034
EditorGUILayout.HelpBox(String.Format("Load Path: {0}", settings.profileSettings.EvaluateString(settings.activeProfileId, baseLoadPathValue)), MessageType.None);
10351035
}

Editor/GUI/AddressableAssetsSettingsGroupTreeView.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,8 +1183,7 @@ internal void CreateNewGroup(object context)
11831183
var groupTemplate = context as AddressableAssetGroupTemplate;
11841184
if (groupTemplate != null)
11851185
{
1186-
var newGroup = m_Editor.settings.CreateGroup(groupTemplate.Name, false, false, true, null, groupTemplate.GetTypes());
1187-
groupTemplate.ApplyToAddressableAssetGroup(newGroup);
1186+
var newGroup = m_Editor.settings.CreateGroup(groupTemplate.Name, false, false, true, groupTemplate.SchemaObjects);
11881187
}
11891188
else
11901189
{

Editor/Settings/GroupSchemas/BundledAssetGroupSchema.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,8 +1492,8 @@ void ShowPathsPreview(bool showMixedValue)
14921492
if (m_ShowPaths)
14931493
{
14941494
EditorStyles.helpBox.fontSize = 12;
1495-
var buildPathValue = m_BuildPath.GetValue(settings);
1496-
var loadPathValue = m_LoadPath.GetValue(settings);
1495+
var buildPathValue = !string.IsNullOrEmpty(m_BuildPath.Id) ? m_BuildPath.GetValue(settings) : "";
1496+
var loadPathValue = !string.IsNullOrEmpty(m_LoadPath.Id) ? m_LoadPath.GetValue(settings) : "";
14971497
EditorGUILayout.HelpBox(String.Format("Build Path: {0}", showMixedValue ? "-" : buildPathValue),
14981498
MessageType.None);
14991499
EditorGUILayout.HelpBox(String.Format("Load Path: {0}", showMixedValue ? "-" : loadPathValue), MessageType.None);
@@ -1666,7 +1666,7 @@ public Dictionary<DefaultSchemaSettingsBuildTargetGroup, DefaultSchemaSettings[]
16661666
{
16671667
DefaultSchemaSettings defaultLocalSettings = default;
16681668
DefaultSchemaSettings defaultRemoteSettings = default;
1669-
#if UNITY_SWITCH
1669+
#if UNITY_SWITCH || UNITY_SWITCH2
16701670
defaultLocalSettings.compression = BundleCompressionMode.Uncompressed;
16711671
defaultLocalSettings.useAssetBundleCache = false; // bundle caching not supported
16721672
defaultLocalSettings.assetBundledCacheClearBehavior = CacheClearBehavior.ClearWhenSpaceIsNeededInCache;

Runtime/AddressablesImpl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ public AsyncOperationHandle<IResourceLocator> InitializeAsync(string runtimeData
374374
return m_InitializationOperation;
375375
//these need to be referenced in order to prevent stripping on IL2CPP platforms.
376376
GC.KeepAlive(Application.streamingAssetsPath);
377-
#if !UNITY_SWITCH
377+
#if !UNITY_SWITCH && !UNITY_SWITCH2
378378
GC.KeepAlive(Application.persistentDataPath);
379379
#endif
380380
if (string.IsNullOrEmpty(runtimeDataPath))
@@ -493,7 +493,7 @@ public ResourceLocationBase CreateCatalogLocationWithHashDependencies<T>(string
493493
};
494494
catalogLoc.Dependencies.Add(hashResourceLocation);
495495

496-
#if UNITY_SWITCH
496+
#if UNITY_SWITCH || UNITY_SWITCH2
497497
string cacheHashFilePath = hashFilePath; // ResourceLocationBase does not allow empty string id
498498
#else
499499
// The file name of the local cached catalog + hash file is the hash code of the remote hash path, without query parameters (if any).

Tests/Editor/AssetGroupTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Reflection;
5+
using System.Text.RegularExpressions;
56
using NUnit.Framework;
67
using UnityEditor.AddressableAssets.GUI;
78
using UnityEditor.AddressableAssets.Settings;
@@ -42,7 +43,7 @@ public void RenameInvalidCharactersFails()
4243
var group = Settings.FindGroup(AddressableAssetSettings.DefaultLocalGroupName);
4344
var oldName = group.Name;
4445
string badName = "*#?@>!@*@(#";
45-
LogAssert.Expect(LogType.Error, "Rename of Group failed. Invalid file name: '" + badName + ".asset'");
46+
LogAssert.Expect(LogType.Error, new Regex($"Invalid file name: '{Regex.Escape(badName)}\\.asset'"));
4647
group.Name = badName;
4748
Assert.AreEqual(oldName, group.Name);
4849
}

0 commit comments

Comments
 (0)