Skip to content

Commit d918926

Browse files
committed
remp
1 parent 1c7fd67 commit d918926

15 files changed

Lines changed: 43 additions & 34 deletions

Assets/SmartAddresser/Editor/Core/Models/LayoutRules/LabelRules/AssetPathBasedLabelProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using SmartAddresser.Editor.Core.Models.Shared;
3+
using UnityEditor.AddressableAssets.Settings;
34

45
namespace SmartAddresser.Editor.Core.Models.LayoutRules.LabelRules
56
{
@@ -15,7 +16,7 @@ public void Setup()
1516
}
1617

1718
public string Provide(string assetPath, Type assetType, bool isFolder, string address,
18-
string addressableAssetGroupName)
19+
AddressableAssetGroup addressableAssetGroup)
1920
{
2021
return ((IProvider<string>)this).Provide(assetPath, assetType, isFolder);
2122
}

Assets/SmartAddresser/Editor/Core/Models/LayoutRules/LabelRules/ConstantLabelProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using UnityEditor.AddressableAssets.Settings;
23
using UnityEngine;
34

45
namespace SmartAddresser.Editor.Core.Models.LayoutRules.LabelRules
@@ -21,7 +22,7 @@ public void Setup()
2122
{
2223
}
2324

24-
public string Provide(string assetPath, Type assetType, bool isFolder, string address, string addressableAssetGroupName)
25+
public string Provide(string assetPath, Type assetType, bool isFolder, string address, AddressableAssetGroup addressableAssetGroup)
2526
{
2627
if (string.IsNullOrEmpty(_label))
2728
return null;

Assets/SmartAddresser/Editor/Core/Models/LayoutRules/LabelRules/CustomLabelProvider.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using UnityEditor.AddressableAssets.Settings;
23

34
namespace SmartAddresser.Editor.Core.Models.LayoutRules.LabelRules
45
{
@@ -15,12 +16,12 @@ public void Setup()
1516
labelProvider.Setup();
1617
}
1718

18-
public string Provide(string assetPath, Type assetType, bool isFolder, string address, string addressableAssetGroupName)
19+
public string Provide(string assetPath, Type assetType, bool isFolder, string address, AddressableAssetGroup addressableAssetGroup)
1920
{
2021
if (labelProvider == null)
2122
return null;
2223

23-
return labelProvider.Provide(assetPath, assetType, isFolder, address, addressableAssetGroupName);
24+
return labelProvider.Provide(assetPath, assetType, isFolder, address, addressableAssetGroup);
2425
}
2526

2627
public string GetDescription()

Assets/SmartAddresser/Editor/Core/Models/LayoutRules/LabelRules/ILabelProvider.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using UnityEditor.AddressableAssets.Settings;
23

34
namespace SmartAddresser.Editor.Core.Models.LayoutRules.LabelRules
45
{
@@ -19,9 +20,9 @@ public interface ILabelProvider
1920
/// <param name="assetType">The type of the asset.</param>
2021
/// <param name="isFolder">The asset is folder or not.</param>
2122
/// <param name="address">The address assigned to the addressable entry.</param>
22-
/// <param name="addressableAssetGroupName">The name of the addressable asset group.</param>
23+
/// <param name="addressableAssetGroup">The addressable asset group.</param>
2324
/// <returns>Returns the label. If the label cannot be provided, returns null.</returns>
24-
string Provide(string assetPath, Type assetType, bool isFolder, string address, string addressableAssetGroupName);
25+
string Provide(string assetPath, Type assetType, bool isFolder, string address, AddressableAssetGroup addressableAssetGroup);
2526

2627
/// <summary>
2728
/// Get the description of this rule for display in the UI.

Assets/SmartAddresser/Editor/Core/Models/LayoutRules/LabelRules/LabelProviderAsset.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using UnityEditor.AddressableAssets.Settings;
23
using UnityEngine;
34

45
namespace SmartAddresser.Editor.Core.Models.LayoutRules.LabelRules
@@ -8,7 +9,7 @@ public abstract class LabelProviderAsset : ScriptableObject, ILabelProvider
89
public abstract void Setup();
910

1011
public abstract string Provide(string assetPath, Type assetType, bool isFolder, string address,
11-
string addressableAssetGroupName);
12+
AddressableAssetGroup addressableAssetGroup);
1213

1314
public abstract string GetDescription();
1415
}

Assets/SmartAddresser/Editor/Core/Models/LayoutRules/LabelRules/LabelRule.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using SmartAddresser.Editor.Core.Models.Shared.AssetGroups.ValidationError;
55
using SmartAddresser.Editor.Foundation.TinyRx.ObservableCollection;
66
using SmartAddresser.Editor.Foundation.TinyRx.ObservableProperty;
7+
using UnityEditor.AddressableAssets.Settings;
78
using UnityEngine;
89

910
namespace SmartAddresser.Editor.Core.Models.LayoutRules.LabelRules
@@ -85,7 +86,7 @@ public bool Validate(out LabelRuleValidationError error)
8586
/// <param name="assetType"></param>
8687
/// <param name="isFolder"></param>
8788
/// <param name="address">The address assigned to the addressable entry.</param>
88-
/// <param name="addressableAssetGroupName">The name of the addressable asset group.</param>
89+
/// <param name="addressableAssetGroup">The addressable asset group.</param>
8990
/// <param name="label">If successful, assign the label. If not, null.</param>
9091
/// <param name="checkIsPathValidForEntry">
9192
/// If true, check if the asset path is valid for entry.
@@ -97,7 +98,7 @@ public bool TryProvideLabel(
9798
Type assetType,
9899
bool isFolder,
99100
string address,
100-
string addressableAssetGroupName,
101+
AddressableAssetGroup addressableAssetGroup,
101102
out string label,
102103
bool checkIsPathValidForEntry = true
103104
)
@@ -114,7 +115,7 @@ public bool TryProvideLabel(
114115
return false;
115116
}
116117

117-
label = LabelProvider.Value.Provide(assetPath, assetType, isFolder, address, addressableAssetGroupName);
118+
label = LabelProvider.Value.Provide(assetPath, assetType, isFolder, address, addressableAssetGroup);
118119

119120
if (string.IsNullOrEmpty(label))
120121
{

Assets/SmartAddresser/Editor/Core/Models/LayoutRules/LayoutRule.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ out AddressableAssetGroup addressableGroup
111111
/// <param name="assetType"></param>
112112
/// <param name="isFolder"></param>
113113
/// <param name="address">The address assigned to the addressable entry.</param>
114-
/// <param name="addressableAssetGroupName">The name of the addressable asset group.</param>
114+
/// <param name="addressableAssetGroup">The addressable asset group.</param>
115115
/// <param name="doSetup"></param>
116116
/// <param name="checkIsPathValidForEntry">
117117
/// If true, check if the asset path is valid for entry.
@@ -123,7 +123,7 @@ public IReadOnlyCollection<string> ProvideLabels(
123123
Type assetType,
124124
bool isFolder,
125125
string address,
126-
string addressableAssetGroupName,
126+
AddressableAssetGroup addressableAssetGroup,
127127
bool doSetup,
128128
bool checkIsPathValidForEntry = true
129129
)
@@ -136,22 +136,22 @@ public IReadOnlyCollection<string> ProvideLabels(
136136
if (doSetup)
137137
labelRule.Setup();
138138

139-
if (labelRule.TryProvideLabel(assetPath, assetType, isFolder, address, addressableAssetGroupName, out var label, checkIsPathValidForEntry))
139+
if (labelRule.TryProvideLabel(assetPath, assetType, isFolder, address, addressableAssetGroup, out var label, checkIsPathValidForEntry))
140140
labels.Add(label);
141141
}
142142

143143
return labels;
144144
}
145145

146-
public string ProvideVersion(string assetPath, Type assetType, bool isFolder, string address, string addressableAssetGroupName, bool doSetup)
146+
public string ProvideVersion(string assetPath, Type assetType, bool isFolder, string address, AddressableAssetGroup addressableAssetGroup, bool doSetup)
147147
{
148148
foreach (var versionRule in _versionRules)
149149
{
150150
if (doSetup)
151151
versionRule.Setup();
152152

153153
// Adopt the first matching version.
154-
if (versionRule.TryProvideVersion(assetPath, assetType, isFolder, address, addressableAssetGroupName, out var version))
154+
if (versionRule.TryProvideVersion(assetPath, assetType, isFolder, address, addressableAssetGroup, out var version))
155155
return version;
156156
}
157157

Assets/SmartAddresser/Editor/Core/Models/LayoutRules/VersionRules/AssetPathBasedVersionProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using SmartAddresser.Editor.Core.Models.Shared;
3+
using UnityEditor.AddressableAssets.Settings;
34

45
namespace SmartAddresser.Editor.Core.Models.LayoutRules.VersionRules
56
{
@@ -14,7 +15,7 @@ public void Setup()
1415
((IProvider<string>)this).Setup();
1516
}
1617

17-
public string Provide(string assetPath, Type assetType, bool isFolder, string address, string addressableAssetGroupName)
18+
public string Provide(string assetPath, Type assetType, bool isFolder, string address, AddressableAssetGroup addressableAssetGroup)
1819
{
1920
// Asset path based provider doesn't use address or addressableAssetGroupName
2021
return ((IProvider<string>)this).Provide(assetPath, assetType, isFolder);

Assets/SmartAddresser/Editor/Core/Models/LayoutRules/VersionRules/ConstantVersionProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using UnityEditor.AddressableAssets.Settings;
23
using UnityEngine;
34

45
namespace SmartAddresser.Editor.Core.Models.LayoutRules.VersionRules
@@ -21,7 +22,7 @@ public void Setup()
2122
{
2223
}
2324

24-
public string Provide(string assetPath, Type assetType, bool isFolder, string address, string addressableAssetGroupName)
25+
public string Provide(string assetPath, Type assetType, bool isFolder, string address, AddressableAssetGroup addressableAssetGroup)
2526
{
2627
if (string.IsNullOrEmpty(_version))
2728
return null;

Assets/SmartAddresser/Editor/Core/Models/LayoutRules/VersionRules/CustomVersionProvider.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using UnityEditor.AddressableAssets.Settings;
23

34
namespace SmartAddresser.Editor.Core.Models.LayoutRules.VersionRules
45
{
@@ -15,12 +16,12 @@ public void Setup()
1516
versionProvider.Setup();
1617
}
1718

18-
public string Provide(string assetPath, Type assetType, bool isFolder, string address, string addressableAssetGroupName)
19+
public string Provide(string assetPath, Type assetType, bool isFolder, string address, AddressableAssetGroup addressableAssetGroup)
1920
{
2021
if (versionProvider == null)
2122
return null;
2223

23-
return versionProvider.Provide(assetPath, assetType, isFolder, address, addressableAssetGroupName);
24+
return versionProvider.Provide(assetPath, assetType, isFolder, address, addressableAssetGroup);
2425
}
2526

2627
public string GetDescription()

0 commit comments

Comments
 (0)