com.wallstop-studios.unity-helpers 2.0.0-rc77 → 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
- Object[] assets = AssetDatabase.LoadAllAssetsAtPath(assetPath);
568
- foreach (Object asset in assets)
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 mA = TrailingNumberRegex.Match(nameA);
62
- Match mB = TrailingNumberRegex.Match(nameB);
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 (hasNumberA && hasNumberB)
65
+ if (matchA.Success && matchB.Success)
69
66
  {
70
- string prefixA = mA.Groups[1].Value;
71
- string prefixB = mB.Groups[1].Value;
67
+ string prefixA = matchA.Groups[1].Value;
68
+ string prefixB = matchB.Groups[1].Value;
72
69
 
73
- int prefixCompare = StringComparer.OrdinalIgnoreCase.Compare(prefixA, prefixB);
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(mA.Groups[2].Value);
81
- int numB = int.Parse(mB.Groups[2].Value);
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
- if (hasNumberB)
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-rc77",
3
+ "version": "2.0.0-rc77.1",
4
4
  "displayName": "Unity Helpers",
5
5
  "description": "Various Unity Helper Library",
6
6
  "dependencies": {},
@@ -84,5 +84,6 @@
84
84
 
85
85
 
86
86
 
87
+
87
88
 
88
89