Skip to content

Commit 8b14189

Browse files
committed
AASのsortOrderをLayoutRuleEditorに反映
1 parent 6ddce70 commit 8b14189

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Assets/SmartAddresser/Editor/Core/Tools/Addresser/LayoutRuleEditor/LayoutRuleEditorPresenter.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using UnityEditor;
1818
using UnityEditor.AddressableAssets;
1919
using UnityEditor.AddressableAssets.Settings;
20+
using UnityEditor.AddressableAssets.Settings.GroupSchemas;
2021
using UnityEngine;
2122

2223
namespace SmartAddresser.Editor.Core.Tools.Addresser.LayoutRuleEditor
@@ -110,7 +111,16 @@ private void SetupActiveView(LayoutRuleData data)
110111
_editingData.Value = data;
111112
_assetSaveService.SetAsset(data);
112113

113-
if (data.LayoutRule.SyncAddressRulesWithAddressableAssetGroups(addressableAssetSettings.groups))
114+
var groups = addressableAssetSettings.groups;
115+
116+
#if AAS_SORT_ORDER
117+
var orderSettings = AddressableAssetGroupSortSettings.GetSettings(addressableAssetSettings);
118+
groups = addressableAssetSettings.groups
119+
.OrderBy(g => Array.IndexOf(orderSettings.sortOrder, g.Guid))
120+
.ToList();
121+
#endif
122+
123+
if (data.LayoutRule.SyncAddressRulesWithAddressableAssetGroups(groups))
114124
_assetSaveService.MarkAsDirty();
115125

116126
_addressRuleEditorPresenter.SetupView(data.LayoutRule.AddressRules);

Assets/SmartAddresser/Editor/SmartAddresser.Editor.asmdef

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@
1515
"precompiledReferences": [],
1616
"autoReferenced": true,
1717
"defineConstraints": [],
18-
"versionDefines": [],
18+
"versionDefines": [
19+
{
20+
"name": "com.unity.addressables",
21+
"expression": "[1.23.1,2.0.0)",
22+
"define": "AAS_SORT_ORDER"
23+
},
24+
{
25+
"name": "com.unity.addressables",
26+
"expression": "2.3.7",
27+
"define": "AAS_SORT_ORDER"
28+
}
29+
],
1930
"noEngineReferences": false
2031
}

0 commit comments

Comments
 (0)