com.wallstop-studios.unity-helpers 2.0.0-rc73 → 2.0.0-rc73.10

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.
Files changed (63) hide show
  1. package/Editor/AnimationCopier.cs +58 -50
  2. package/Editor/AnimationCreator.cs +18 -25
  3. package/Editor/AnimationEventEditor.cs +11 -23
  4. package/Editor/FitTextureSizeWindow.cs +9 -9
  5. package/Editor/PrefabChecker.cs +14 -19
  6. package/Editor/SpriteAtlasGenerator.cs +503 -206
  7. package/Editor/SpriteCropper.cs +157 -131
  8. package/Editor/SpriteSettingsApplier.cs +5 -3
  9. package/Editor/Utils/GUIHorizontalScope.cs +20 -0
  10. package/Editor/Utils/GUIHorizontalScope.cs.meta +3 -0
  11. package/Editor/Utils/GUIIndentScope.cs +20 -0
  12. package/Editor/Utils/GUIIndentScope.cs.meta +3 -0
  13. package/Runtime/Core/DataStructure/Circle.cs +1 -1
  14. package/Runtime/Core/DataStructure/QuadTree.cs +4 -4
  15. package/Runtime/Core/Extension/ColorExtensions.cs +5 -5
  16. package/Runtime/Core/Extension/IEnumerableExtensions.cs +1 -1
  17. package/Runtime/Core/Extension/StringExtensions.cs +49 -0
  18. package/Runtime/Core/Extension/UnityExtensions.cs +14 -14
  19. package/Runtime/Core/Helper/Helpers.cs +9 -9
  20. package/Runtime/Core/Helper/Logging/UnityLogTagFormatter.cs +31 -8
  21. package/Runtime/Core/Helper/Partials/ObjectHelpers.cs +2 -2
  22. package/Runtime/Core/Helper/PathHelper.cs +15 -0
  23. package/Runtime/Core/Helper/PathHelper.cs.meta +3 -0
  24. package/Runtime/Core/Random/DotNetRandom.cs +1 -1
  25. package/Runtime/Core/Random/SplitMix64.cs +1 -1
  26. package/Runtime/Core/Random/SquirrelRandom.cs +7 -7
  27. package/Runtime/Core/Random/ThreadLocalRandom.cs +1 -1
  28. package/Runtime/Core/Random/WyRandom.cs +1 -1
  29. package/Runtime/Tags/AttributeEffect.cs +1 -0
  30. package/Runtime/Tags/EffectHandler.cs +1 -1
  31. package/Runtime/UI/LayeredImage.cs +309 -161
  32. package/Runtime/Utils/AnimatorEnumStateMachine.cs +1 -1
  33. package/Runtime/Utils/SetTextureImportData.cs +1 -1
  34. package/Runtime/Utils/TextureScale.cs +4 -4
  35. package/Styles/Elements/Progress/ArcedProgressBar.cs +345 -0
  36. package/Styles/Elements/Progress/ArcedProgressBar.cs.meta +3 -0
  37. package/Styles/Elements/Progress/CircularProgressBar.cs +307 -0
  38. package/Styles/Elements/Progress/CircularProgressBar.cs.meta +3 -0
  39. package/Styles/Elements/Progress/GlitchProgressBar.cs +416 -0
  40. package/Styles/Elements/Progress/GlitchProgressBar.cs.meta +3 -0
  41. package/Styles/Elements/Progress/LiquidProgressBar.cs +632 -0
  42. package/Styles/Elements/Progress/LiquidProgressBar.cs.meta +3 -0
  43. package/Styles/Elements/Progress/MarchingAntsProgressBar.cs +722 -0
  44. package/Styles/Elements/Progress/MarchingAntsProgressBar.cs.meta +3 -0
  45. package/Styles/Elements/Progress/RegularProgressBar.cs +405 -0
  46. package/Styles/Elements/Progress/RegularProgressBar.cs.meta +3 -0
  47. package/Styles/Elements/Progress/WigglyProgressBar.cs +837 -0
  48. package/Styles/Elements/Progress/WigglyProgressBar.cs.meta +3 -0
  49. package/Styles/Elements/Progress.meta +3 -0
  50. package/Styles/Elements.meta +3 -0
  51. package/Styles/USS/ArcedProgressBar.uss +19 -0
  52. package/Styles/USS/ArcedProgressBar.uss.meta +3 -0
  53. package/Styles/USS/CirclularProgressBar.uss +18 -0
  54. package/Styles/USS/CirclularProgressBar.uss.meta +3 -0
  55. package/Styles/USS/RegularProgressBar.uss +33 -0
  56. package/Styles/USS/RegularProgressBar.uss.meta +3 -0
  57. package/Styles/USS/WigglyProgressBar.uss +17 -0
  58. package/Styles/USS/WigglyProgressBar.uss.meta +3 -0
  59. package/Styles/USS.meta +3 -0
  60. package/Styles/WallstopStudios.UnityHelpers.Styles.asmdef +17 -0
  61. package/Styles/WallstopStudios.UnityHelpers.Styles.asmdef.meta +7 -0
  62. package/Styles.meta +3 -0
  63. package/package.json +11 -1
@@ -47,9 +47,9 @@
47
47
  }
48
48
 
49
49
  float a =
50
- (targetVelocity.x * targetVelocity.x)
51
- + (targetVelocity.y * targetVelocity.y)
52
- - (projectileSpeed * projectileSpeed);
50
+ targetVelocity.x * targetVelocity.x
51
+ + targetVelocity.y * targetVelocity.y
52
+ - projectileSpeed * projectileSpeed;
53
53
 
54
54
  float b =
55
55
  2
@@ -59,10 +59,10 @@
59
59
  );
60
60
 
61
61
  float c =
62
- ((target.x - launchLocation.x) * (target.x - launchLocation.x))
63
- + ((target.y - launchLocation.y) * (target.y - launchLocation.y));
62
+ (target.x - launchLocation.x) * (target.x - launchLocation.x)
63
+ + (target.y - launchLocation.y) * (target.y - launchLocation.y);
64
64
 
65
- float disc = b * b - (4 * a * c);
65
+ float disc = b * b - 4 * a * c;
66
66
  if (disc < 0)
67
67
  {
68
68
  return target;
@@ -72,8 +72,8 @@
72
72
  float t2 = (-1 * b - Mathf.Sqrt(disc)) / (2 * a);
73
73
  float t = Mathf.Max(t1, t2); // let us take the larger time value
74
74
 
75
- float aimX = target.x + (targetVelocity.x * t);
76
- float aimY = target.y + (targetVelocity.y * t);
75
+ float aimX = target.x + targetVelocity.x * t;
76
+ float aimY = target.y + targetVelocity.y * t;
77
77
 
78
78
  if (float.IsNaN(aimX) || float.IsNaN(aimY))
79
79
  {
@@ -283,7 +283,7 @@
283
283
  // optional delay execution from happening on 0, 1, 2, ... n-1 to 1, 2, ... n
284
284
  if (
285
285
  totalExecuted < totalCount
286
- && ((totalExecuted + (delay ? 1f : 0f)) / totalCount) <= percent
286
+ && (totalExecuted + (delay ? 1f : 0f)) / totalCount <= percent
287
287
  )
288
288
  {
289
289
  action();
@@ -137,11 +137,9 @@
137
137
  const string sizeCheck = "size=";
138
138
  AddDecoration(
139
139
  format =>
140
- (
141
- format.StartsWith(sizeCheck, StringComparison.OrdinalIgnoreCase)
142
- && int.TryParse(format.Substring(sizeCheck.Length), out _)
143
- || int.TryParse(format, out _)
144
- ),
140
+ format.StartsWith(sizeCheck, StringComparison.OrdinalIgnoreCase)
141
+ && int.TryParse(format.Substring(sizeCheck.Length), out _)
142
+ || int.TryParse(format, out _),
145
143
  format: (format, value) =>
146
144
  {
147
145
  if (!int.TryParse(format, out int size))
@@ -373,11 +371,26 @@
373
371
  )
374
372
  {
375
373
  bool stopLooping = false;
376
- foreach (var entry in _matchingDecorations)
374
+ foreach (
375
+ KeyValuePair<
376
+ int,
377
+ List<(
378
+ string tag,
379
+ bool editorOnly,
380
+ Func<string, bool> predicate,
381
+ Func<string, object, string> formatter
382
+ )>
383
+ > entry in _matchingDecorations
384
+ )
377
385
  {
378
386
  for (int i = 0; i < entry.Value.Count; i++)
379
387
  {
380
- var existingDecoration = entry.Value[i];
388
+ (
389
+ string tag,
390
+ bool editorOnly,
391
+ Func<string, bool> predicate,
392
+ Func<string, object, string> formatter
393
+ ) existingDecoration = entry.Value[i];
381
394
  if (
382
395
  !string.Equals(
383
396
  existingDecoration.tag,
@@ -459,7 +472,17 @@
459
472
  ) decoration
460
473
  )
461
474
  {
462
- foreach (var entry in _matchingDecorations)
475
+ foreach (
476
+ KeyValuePair<
477
+ int,
478
+ List<(
479
+ string tag,
480
+ bool editorOnly,
481
+ Func<string, bool> predicate,
482
+ Func<string, object, string> formatter
483
+ )>
484
+ > entry in _matchingDecorations
485
+ )
463
486
  {
464
487
  for (int i = 0; i < entry.Value.Count; ++i)
465
488
  {
@@ -156,7 +156,7 @@
156
156
  }
157
157
  }
158
158
 
159
- Transform transform = (component as Transform) ?? component.transform;
159
+ Transform transform = component as Transform ?? component.transform;
160
160
  if (transform == null)
161
161
  {
162
162
  return;
@@ -187,7 +187,7 @@
187
187
  behavior.enabled = enabled;
188
188
  }
189
189
 
190
- Transform transform = (component as Transform) ?? component.transform;
190
+ Transform transform = component as Transform ?? component.transform;
191
191
  if (transform == null)
192
192
  {
193
193
  return;
@@ -0,0 +1,15 @@
1
+ using System.Runtime.CompilerServices;
2
+
3
+ [assembly: InternalsVisibleTo(assemblyName: "WallstopStudios.UnityHelpers.Styles")]
4
+ [assembly: InternalsVisibleTo(assemblyName: "WallstopStudios.UnityHelpers.Editor")]
5
+
6
+ namespace WallstopStudios.UnityHelpers.Core.Helper
7
+ {
8
+ internal static class PathHelper
9
+ {
10
+ public static string SanitizePath(this string path)
11
+ {
12
+ return path?.Replace('\\', '/');
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 8505d4ced07d414aaf2c677ce5283997
3
+ timeCreated: 1746657053
@@ -11,7 +11,7 @@
11
11
  public static DotNetRandom Instance => ThreadLocalRandom<DotNetRandom>.Instance;
12
12
 
13
13
  public override RandomState InternalState =>
14
- new RandomState(unchecked((ulong)_seed), state2: _numberGenerated);
14
+ new(unchecked((ulong)_seed), state2: _numberGenerated);
15
15
 
16
16
  private ulong _numberGenerated;
17
17
  private int _seed;
@@ -45,7 +45,7 @@
45
45
  ulong z = _state;
46
46
  z = (z ^ (z >> 30)) * 0xBF58476D1CE4E5B9UL;
47
47
  z = (z ^ (z >> 27)) * 0x94D049BB133111EBUL;
48
- z ^= (z >> 31);
48
+ z ^= z >> 31;
49
49
 
50
50
  return (uint)z;
51
51
  }
@@ -54,11 +54,11 @@
54
54
  private static uint NextUintInternal(ref uint seed)
55
55
  {
56
56
  seed *= BitNoise1;
57
- seed ^= (seed >> 8);
57
+ seed ^= seed >> 8;
58
58
  seed += BitNoise2;
59
- seed ^= (seed << 8);
59
+ seed ^= seed << 8;
60
60
  seed *= BitNoise3;
61
- seed ^= (seed >> 8);
61
+ seed ^= seed >> 8;
62
62
  return seed;
63
63
  }
64
64
 
@@ -68,17 +68,17 @@
68
68
  uint result = unchecked((uint)x);
69
69
  result *= BitNoise1;
70
70
  result += seed;
71
- result ^= (result >> 8);
71
+ result ^= result >> 8;
72
72
  result += BitNoise2;
73
- result ^= (result << 8);
73
+ result ^= result << 8;
74
74
  result *= BitNoise3;
75
- result ^= (result >> 8);
75
+ result ^= result >> 8;
76
76
  return (result >> 8) * MagicFloat;
77
77
  }
78
78
 
79
79
  private static float NextNoise(int x, int y, uint seed)
80
80
  {
81
- return NextNoise(x + (LargePrime * y), seed);
81
+ return NextNoise(x + LargePrime * y, seed);
82
82
  }
83
83
  }
84
84
  }
@@ -5,7 +5,7 @@
5
5
  public static class ThreadLocalRandom<T>
6
6
  where T : IRandom, new()
7
7
  {
8
- private static readonly ThreadLocal<T> RandomCache = new ThreadLocal<T>(() => new T());
8
+ private static readonly ThreadLocal<T> RandomCache = new(() => new T());
9
9
 
10
10
  public static T Instance => RandomCache.Value;
11
11
  }
@@ -16,7 +16,7 @@
16
16
 
17
17
  public static WyRandom Instance => ThreadLocalRandom<WyRandom>.Instance;
18
18
 
19
- public override RandomState InternalState => new RandomState(_state);
19
+ public override RandomState InternalState => new(_state);
20
20
 
21
21
  private ulong _state;
22
22
 
@@ -8,6 +8,7 @@
8
8
  using System.Text.Json.Serialization;
9
9
  using Core.Extension;
10
10
  using Core.Helper;
11
+ using UnityEngine;
11
12
  #if ODIN_INSPECTOR
12
13
  using Sirenix.OdinInspector;
13
14
  #endif
@@ -297,7 +297,7 @@
297
297
  if (cosmeticEffectData.RequiresInstancing)
298
298
  {
299
299
  this.LogWarn(
300
- $"Double-deregistration detected for handle {handle:json}. Existing handles: [{(string.Join(",", _instancedCosmeticEffects.Keys))}]."
300
+ $"Double-deregistration detected for handle {handle:json}. Existing handles: [{string.Join(",", _instancedCosmeticEffects.Keys)}]."
301
301
  );
302
302
  continue;
303
303
  }