com.wallstop-studios.unity-helpers 2.0.0-rc76.9 → 2.0.0-rc77.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -564,8 +564,11 @@
|
|
|
564
564
|
|
|
565
565
|
if (allMatch)
|
|
566
566
|
{
|
|
567
|
-
|
|
568
|
-
|
|
567
|
+
foreach (
|
|
568
|
+
Object asset in AssetDatabase
|
|
569
|
+
.LoadAllAssetsAtPath(assetPath)
|
|
570
|
+
.Concat(AssetDatabase.LoadAllAssetRepresentationsAtPath(assetPath))
|
|
571
|
+
)
|
|
569
572
|
{
|
|
570
573
|
if (asset is Sprite spriteAsset && spriteAsset != null)
|
|
571
574
|
{
|
|
@@ -58,42 +58,32 @@
|
|
|
58
58
|
|
|
59
59
|
private static int CompareNatural(string nameA, string nameB)
|
|
60
60
|
{
|
|
61
|
-
Match
|
|
62
|
-
Match
|
|
63
|
-
|
|
64
|
-
bool hasNumberA = mA.Success;
|
|
65
|
-
bool hasNumberB = mB.Success;
|
|
61
|
+
Match matchA = TrailingNumberRegex.Match(nameA);
|
|
62
|
+
Match matchB = TrailingNumberRegex.Match(nameB);
|
|
66
63
|
|
|
67
64
|
// If both have trailing numbers, compare prefix then numeric
|
|
68
|
-
if (
|
|
65
|
+
if (matchA.Success && matchB.Success)
|
|
69
66
|
{
|
|
70
|
-
string prefixA =
|
|
71
|
-
string prefixB =
|
|
67
|
+
string prefixA = matchA.Groups[1].Value;
|
|
68
|
+
string prefixB = matchB.Groups[1].Value;
|
|
72
69
|
|
|
73
|
-
int prefixCompare =
|
|
70
|
+
int prefixCompare = string.Compare(
|
|
71
|
+
prefixA,
|
|
72
|
+
prefixB,
|
|
73
|
+
StringComparison.OrdinalIgnoreCase
|
|
74
|
+
);
|
|
74
75
|
if (prefixCompare != 0)
|
|
75
76
|
{
|
|
76
77
|
return prefixCompare;
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
// same prefix → compare parsed integers
|
|
80
|
-
int numA = int.Parse(
|
|
81
|
-
int numB = int.Parse(
|
|
81
|
+
int numA = int.Parse(matchA.Groups[2].Value);
|
|
82
|
+
int numB = int.Parse(matchB.Groups[2].Value);
|
|
82
83
|
return numA.CompareTo(numB);
|
|
83
84
|
}
|
|
84
|
-
// If only one has a trailing number, treat the one without number as coming first
|
|
85
|
-
|
|
86
|
-
if (hasNumberA)
|
|
87
|
-
{
|
|
88
|
-
return 1; // B (no number) comes before A
|
|
89
|
-
}
|
|
90
85
|
|
|
91
|
-
|
|
92
|
-
{
|
|
93
|
-
return -1; // A (no number) comes before B
|
|
94
|
-
}
|
|
95
|
-
// Neither has a trailing number → pure string compare
|
|
96
|
-
return StringComparer.OrdinalIgnoreCase.Compare(nameA, nameB);
|
|
86
|
+
return string.Compare(nameA, nameB, StringComparison.OrdinalIgnoreCase);
|
|
97
87
|
}
|
|
98
88
|
}
|
|
99
89
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "com.wallstop-studios.unity-helpers",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-rc77.1",
|
|
4
4
|
"displayName": "Unity Helpers",
|
|
5
5
|
"description": "Various Unity Helper Library",
|
|
6
6
|
"dependencies": {},
|
|
@@ -82,6 +82,8 @@
|
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
|
|
85
|
+
|
|
86
|
+
|
|
85
87
|
|
|
86
88
|
|
|
87
89
|
|