com.wallstop-studios.unity-helpers 2.0.0-rc73.2 → 2.0.0-rc73.3

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 (26) hide show
  1. package/Runtime/Tags/AttributeEffect.cs +1 -0
  2. package/Styles/Elements/Progress/ArcedProgressBar.cs +345 -0
  3. package/Styles/Elements/Progress/ArcedProgressBar.cs.meta +3 -0
  4. package/Styles/Elements/{CircularProgressBar.cs → Progress/CircularProgressBar.cs} +56 -55
  5. package/Styles/Elements/Progress/GlitchProgressBar.cs +416 -0
  6. package/Styles/Elements/Progress/GlitchProgressBar.cs.meta +3 -0
  7. package/Styles/Elements/Progress/LiquidProgressBar.cs +632 -0
  8. package/Styles/Elements/Progress/LiquidProgressBar.cs.meta +3 -0
  9. package/Styles/Elements/Progress/MarchingAntsProgressBar.cs +722 -0
  10. package/Styles/Elements/Progress/MarchingAntsProgressBar.cs.meta +3 -0
  11. package/Styles/Elements/{RegularProgressBar.cs → Progress/RegularProgressBar.cs} +24 -13
  12. package/Styles/Elements/Progress/WigglyProgressBar.cs +837 -0
  13. package/Styles/Elements/Progress/WigglyProgressBar.cs.meta +3 -0
  14. package/Styles/Elements/Progress.meta +3 -0
  15. package/Styles/USS/ArcedProgressBar.uss +19 -0
  16. package/Styles/USS/ArcedProgressBar.uss.meta +3 -0
  17. package/Styles/USS/WigglyProgressBar.uss +17 -0
  18. package/Styles/USS/WigglyProgressBar.uss.meta +3 -0
  19. package/package.json +2 -1
  20. package/Styles/UXML/CircularProgressBar.uxml +0 -11
  21. package/Styles/UXML/CircularProgressBar.uxml.meta +0 -10
  22. package/Styles/UXML/RegularProgressBar.uxml +0 -22
  23. package/Styles/UXML/RegularProgressBar.uxml.meta +0 -10
  24. package/Styles/UXML.meta +0 -3
  25. /package/Styles/Elements/{CircularProgressBar.cs.meta → Progress/CircularProgressBar.cs.meta} +0 -0
  26. /package/Styles/Elements/{RegularProgressBar.cs.meta → Progress/RegularProgressBar.cs.meta} +0 -0
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 398af6c9ddce4886ae62b9c281cea020
3
+ timeCreated: 1746748265
@@ -1,4 +1,4 @@
1
- namespace WallstopStudios.UnityHelpers.Styles.Elements
1
+ namespace WallstopStudios.UnityHelpers.Styles.Elements.Progress
2
2
  {
3
3
  using System.ComponentModel;
4
4
  using UnityEngine;
@@ -18,7 +18,7 @@
18
18
  private readonly VisualElement _trackElement;
19
19
  private readonly VisualElement _fillElement;
20
20
 
21
- public enum BarOrientation
21
+ public enum OrientationType
22
22
  {
23
23
  Horizontal = 0,
24
24
  Vertical = 1,
@@ -36,6 +36,10 @@
36
36
  get => _progress;
37
37
  set
38
38
  {
39
+ if (float.IsNaN(value) || float.IsInfinity(value))
40
+ {
41
+ return;
42
+ }
39
43
  _progress = Mathf.Clamp01(value);
40
44
  UpdateFillVisuals();
41
45
  }
@@ -69,8 +73,8 @@
69
73
  }
70
74
  }
71
75
 
72
- private BarOrientation _orientation = BarOrientation.Horizontal;
73
- public BarOrientation Orientation
76
+ private OrientationType _orientation = OrientationType.Horizontal;
77
+ public OrientationType Orientation
74
78
  {
75
79
  get => _orientation;
76
80
  set
@@ -100,6 +104,10 @@
100
104
  get => _borderRadius;
101
105
  set
102
106
  {
107
+ if (float.IsNaN(value) || float.IsInfinity(value))
108
+ {
109
+ return;
110
+ }
103
111
  _borderRadius = Mathf.Max(0, value);
104
112
  ApplyBorderRadius();
105
113
  }
@@ -111,6 +119,10 @@
111
119
  get => _thickness;
112
120
  set
113
121
  {
122
+ if (float.IsNaN(value) || float.IsInfinity(value))
123
+ {
124
+ return;
125
+ }
114
126
  _thickness = Mathf.Max(1, value);
115
127
  UpdateThicknessVisuals();
116
128
  }
@@ -138,8 +150,8 @@
138
150
  defaultValue = new Color(0.2f, 0.7f, 0.2f, 1f),
139
151
  };
140
152
 
141
- private readonly UxmlEnumAttributeDescription<BarOrientation> _orientationAttribute =
142
- new() { name = "orientation", defaultValue = BarOrientation.Horizontal };
153
+ private readonly UxmlEnumAttributeDescription<OrientationType> _orientationAttribute =
154
+ new() { name = "orientation", defaultValue = OrientationType.Horizontal };
143
155
 
144
156
  private readonly UxmlEnumAttributeDescription<FillDirection> _fillAttribute = new()
145
157
  {
@@ -167,7 +179,6 @@
167
179
  Debug.LogError(
168
180
  $"Initialization failed, expected {nameof(RegularProgressBar)}, found {ve?.GetType()}.)"
169
181
  );
170
-
171
182
  return;
172
183
  }
173
184
 
@@ -260,7 +271,7 @@
260
271
 
261
272
  switch (_orientation)
262
273
  {
263
- case BarOrientation.Horizontal:
274
+ case OrientationType.Horizontal:
264
275
  {
265
276
  switch (_fillDirection)
266
277
  {
@@ -294,7 +305,7 @@
294
305
 
295
306
  break;
296
307
  }
297
- case BarOrientation.Vertical:
308
+ case OrientationType.Vertical:
298
309
  {
299
310
  switch (_fillDirection)
300
311
  {
@@ -333,7 +344,7 @@
333
344
  throw new InvalidEnumArgumentException(
334
345
  nameof(_orientation),
335
346
  (int)_orientation,
336
- typeof(BarOrientation)
347
+ typeof(OrientationType)
337
348
  );
338
349
  }
339
350
  }
@@ -368,13 +379,13 @@
368
379
 
369
380
  switch (_orientation)
370
381
  {
371
- case BarOrientation.Horizontal:
382
+ case OrientationType.Horizontal:
372
383
  {
373
384
  _fillElement.style.width = Length.Percent(clampedProgress * 100f);
374
385
  _fillElement.style.height = Length.Percent(100);
375
386
  break;
376
387
  }
377
- case BarOrientation.Vertical:
388
+ case OrientationType.Vertical:
378
389
  {
379
390
  _fillElement.style.height = Length.Percent(clampedProgress * 100f);
380
391
  _fillElement.style.width = Length.Percent(100);
@@ -385,7 +396,7 @@
385
396
  throw new InvalidEnumArgumentException(
386
397
  nameof(_orientation),
387
398
  (int)_orientation,
388
- typeof(BarOrientation)
399
+ typeof(OrientationType)
389
400
  );
390
401
  }
391
402
  }