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.
- package/Runtime/Tags/AttributeEffect.cs +1 -0
- package/Styles/Elements/Progress/ArcedProgressBar.cs +345 -0
- package/Styles/Elements/Progress/ArcedProgressBar.cs.meta +3 -0
- package/Styles/Elements/{CircularProgressBar.cs → Progress/CircularProgressBar.cs} +56 -55
- package/Styles/Elements/Progress/GlitchProgressBar.cs +416 -0
- package/Styles/Elements/Progress/GlitchProgressBar.cs.meta +3 -0
- package/Styles/Elements/Progress/LiquidProgressBar.cs +632 -0
- package/Styles/Elements/Progress/LiquidProgressBar.cs.meta +3 -0
- package/Styles/Elements/Progress/MarchingAntsProgressBar.cs +722 -0
- package/Styles/Elements/Progress/MarchingAntsProgressBar.cs.meta +3 -0
- package/Styles/Elements/{RegularProgressBar.cs → Progress/RegularProgressBar.cs} +24 -13
- package/Styles/Elements/Progress/WigglyProgressBar.cs +837 -0
- package/Styles/Elements/Progress/WigglyProgressBar.cs.meta +3 -0
- package/Styles/Elements/Progress.meta +3 -0
- package/Styles/USS/ArcedProgressBar.uss +19 -0
- package/Styles/USS/ArcedProgressBar.uss.meta +3 -0
- package/Styles/USS/WigglyProgressBar.uss +17 -0
- package/Styles/USS/WigglyProgressBar.uss.meta +3 -0
- package/package.json +2 -1
- package/Styles/UXML/CircularProgressBar.uxml +0 -11
- package/Styles/UXML/CircularProgressBar.uxml.meta +0 -10
- package/Styles/UXML/RegularProgressBar.uxml +0 -22
- package/Styles/UXML/RegularProgressBar.uxml.meta +0 -10
- package/Styles/UXML.meta +0 -3
- /package/Styles/Elements/{CircularProgressBar.cs.meta → Progress/CircularProgressBar.cs.meta} +0 -0
- /package/Styles/Elements/{RegularProgressBar.cs.meta → Progress/RegularProgressBar.cs.meta} +0 -0
|
@@ -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
|
|
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
|
|
73
|
-
public
|
|
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<
|
|
142
|
-
new() { name = "orientation", defaultValue =
|
|
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
|
|
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
|
|
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(
|
|
347
|
+
typeof(OrientationType)
|
|
337
348
|
);
|
|
338
349
|
}
|
|
339
350
|
}
|
|
@@ -368,13 +379,13 @@
|
|
|
368
379
|
|
|
369
380
|
switch (_orientation)
|
|
370
381
|
{
|
|
371
|
-
case
|
|
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
|
|
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(
|
|
399
|
+
typeof(OrientationType)
|
|
389
400
|
);
|
|
390
401
|
}
|
|
391
402
|
}
|