com.wallstop-studios.unity-helpers 2.0.0-rc73.18 → 2.0.0-rc73.2
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/Editor/{Sprites/AnimationCopier.cs → AnimationCopier.cs} +209 -84
- package/Editor/{Sprites/AnimationCreator.cs → AnimationCreator.cs} +100 -29
- package/Editor/AnimationEventEditor.cs +23 -10
- package/Editor/CustomEditors/MatchColliderToSpriteEditor.cs +1 -1
- package/Editor/FitTextureSizeWindow.cs +53 -14
- package/Editor/PrefabChecker.cs +18 -11
- package/Editor/SpriteAtlasGenerator.cs +914 -0
- package/Editor/SpriteAtlasGenerator.cs.meta +3 -0
- package/Editor/{Sprites/SpriteCropper.cs → SpriteCropper.cs} +143 -172
- package/Editor/{Sprites/SpriteSettingsApplier.cs → SpriteSettingsApplier.cs} +77 -12
- package/Editor/{Sprites/TextureResizerWizard.cs → TextureResizerWizard.cs} +1 -1
- package/Editor/{Sprites/TextureSettingsApplier.cs → TextureSettingsApplier.cs} +1 -1
- package/Editor/Utils/DxReadOnlyPropertyDrawer.cs +1 -1
- package/Editor/Utils/GUIHorizontalScope.cs +20 -0
- package/Editor/Utils/GUIHorizontalScope.cs.meta +3 -0
- package/Runtime/Core/DataStructure/Circle.cs +1 -1
- package/Runtime/Core/DataStructure/QuadTree.cs +4 -4
- package/Runtime/Core/Extension/ColorExtensions.cs +5 -5
- package/Runtime/Core/Extension/IEnumerableExtensions.cs +1 -1
- package/Runtime/Core/Extension/UnityExtensions.cs +14 -14
- package/Runtime/Core/Helper/DirectoryHelper.cs +0 -64
- package/Runtime/Core/Helper/Helpers.cs +9 -9
- package/Runtime/Core/Helper/Logging/UnityLogTagFormatter.cs +8 -31
- package/Runtime/Core/Helper/Partials/ObjectHelpers.cs +4 -5
- package/Runtime/Core/Helper/PathHelper.cs +1 -2
- package/Runtime/Core/Random/DotNetRandom.cs +1 -1
- package/Runtime/Core/Random/SplitMix64.cs +1 -1
- package/Runtime/Core/Random/SquirrelRandom.cs +7 -7
- package/Runtime/Core/Random/ThreadLocalRandom.cs +1 -1
- package/Runtime/Core/Random/WyRandom.cs +1 -1
- package/Runtime/Tags/AttributeEffect.cs +0 -1
- package/Runtime/Tags/EffectHandler.cs +1 -1
- package/Runtime/UI/LayeredImage.cs +161 -309
- package/Runtime/Utils/AnimatorEnumStateMachine.cs +1 -1
- package/Runtime/Utils/SetTextureImportData.cs +1 -1
- package/Runtime/Utils/TextureScale.cs +4 -4
- package/Styles/Elements/{Progress/CircularProgressBar.cs → CircularProgressBar.cs} +55 -56
- package/Styles/Elements/{Progress/RegularProgressBar.cs → RegularProgressBar.cs} +13 -24
- package/Styles/UXML/CircularProgressBar.uxml +11 -0
- package/Styles/UXML/CircularProgressBar.uxml.meta +10 -0
- package/Styles/UXML/RegularProgressBar.uxml +22 -0
- package/Styles/UXML/RegularProgressBar.uxml.meta +10 -0
- package/Styles/UXML.meta +3 -0
- package/package.json +1 -17
- package/Editor/CustomEditors/PersistentDirectoryGUI.cs +0 -796
- package/Editor/CustomEditors/PersistentDirectoryGUI.cs.meta +0 -3
- package/Editor/CustomEditors/SourceFolderEntryDrawer.cs +0 -275
- package/Editor/CustomEditors/SourceFolderEntryDrawer.cs.meta +0 -3
- package/Editor/PersistentDirectorySettings.cs +0 -248
- package/Editor/PersistentDirectorySettings.cs.meta +0 -3
- package/Editor/Sprites/ScriptableSpriteAtlas.cs +0 -95
- package/Editor/Sprites/ScriptableSpriteAtlas.cs.meta +0 -3
- package/Editor/Sprites/ScriptableSpriteAtlasEditor.cs +0 -960
- package/Editor/Sprites/ScriptableSpriteAtlasEditor.cs.meta +0 -3
- package/Editor/Sprites.meta +0 -3
- package/Styles/Elements/Progress/ArcedProgressBar.cs +0 -345
- package/Styles/Elements/Progress/ArcedProgressBar.cs.meta +0 -3
- package/Styles/Elements/Progress/GlitchProgressBar.cs +0 -416
- package/Styles/Elements/Progress/GlitchProgressBar.cs.meta +0 -3
- package/Styles/Elements/Progress/LiquidProgressBar.cs +0 -632
- package/Styles/Elements/Progress/LiquidProgressBar.cs.meta +0 -3
- package/Styles/Elements/Progress/MarchingAntsProgressBar.cs +0 -722
- package/Styles/Elements/Progress/MarchingAntsProgressBar.cs.meta +0 -3
- package/Styles/Elements/Progress/WigglyProgressBar.cs +0 -837
- package/Styles/Elements/Progress/WigglyProgressBar.cs.meta +0 -3
- package/Styles/Elements/Progress.meta +0 -3
- package/Styles/USS/ArcedProgressBar.uss +0 -19
- package/Styles/USS/ArcedProgressBar.uss.meta +0 -3
- package/Styles/USS/WigglyProgressBar.uss +0 -17
- package/Styles/USS/WigglyProgressBar.uss.meta +0 -3
- /package/Editor/{Sprites/AnimationCopier.cs.meta → AnimationCopier.cs.meta} +0 -0
- /package/Editor/{Sprites/AnimationCreator.cs.meta → AnimationCreator.cs.meta} +0 -0
- /package/Editor/{Sprites/SpriteCropper.cs.meta → SpriteCropper.cs.meta} +0 -0
- /package/Editor/{Sprites/SpriteSettingsApplier.cs.meta → SpriteSettingsApplier.cs.meta} +0 -0
- /package/Editor/{Sprites/TextureResizerWizard.cs.meta → TextureResizerWizard.cs.meta} +0 -0
- /package/Editor/{Sprites/TextureSettingsApplier.cs.meta → TextureSettingsApplier.cs.meta} +0 -0
- /package/Styles/Elements/{Progress/CircularProgressBar.cs.meta → CircularProgressBar.cs.meta} +0 -0
- /package/Styles/Elements/{Progress/RegularProgressBar.cs.meta → RegularProgressBar.cs.meta} +0 -0
package/Editor/Sprites.meta
DELETED
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
namespace WallstopStudios.UnityHelpers.Styles.Elements.Progress
|
|
2
|
-
{
|
|
3
|
-
using System.ComponentModel;
|
|
4
|
-
using Core.Helper;
|
|
5
|
-
using UnityEngine;
|
|
6
|
-
using UnityEngine.UIElements;
|
|
7
|
-
|
|
8
|
-
public sealed class ArcedProgressBar : VisualElement
|
|
9
|
-
{
|
|
10
|
-
public enum FillDirection
|
|
11
|
-
{
|
|
12
|
-
Forward = 0,
|
|
13
|
-
Reverse = 1,
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public const string USSClassName = "arced-progress-bar";
|
|
17
|
-
public const string USSTrackColorVarName = "--arc-track-color";
|
|
18
|
-
public const string USSProgressColorVarName = "--arc-progress-color";
|
|
19
|
-
public const string USSThicknessVarName = "--arc-thickness";
|
|
20
|
-
|
|
21
|
-
private float _progress = 0.5f;
|
|
22
|
-
|
|
23
|
-
public float Progress
|
|
24
|
-
{
|
|
25
|
-
get => _progress;
|
|
26
|
-
set
|
|
27
|
-
{
|
|
28
|
-
if (float.IsNaN(value) || float.IsInfinity(value))
|
|
29
|
-
{
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
_progress = Mathf.Clamp01(value);
|
|
33
|
-
MarkDirtyRepaint();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
private float _radius = 50f;
|
|
38
|
-
|
|
39
|
-
public float Radius
|
|
40
|
-
{
|
|
41
|
-
get => _radius;
|
|
42
|
-
set
|
|
43
|
-
{
|
|
44
|
-
if (float.IsNaN(value) || float.IsInfinity(value))
|
|
45
|
-
{
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
_radius = Mathf.Max(1f, value);
|
|
49
|
-
UpdateSize();
|
|
50
|
-
MarkDirtyRepaint();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
private float _thickness = 10f;
|
|
55
|
-
|
|
56
|
-
public float Thickness
|
|
57
|
-
{
|
|
58
|
-
get => _thickness;
|
|
59
|
-
set
|
|
60
|
-
{
|
|
61
|
-
if (float.IsNaN(value) || float.IsInfinity(value))
|
|
62
|
-
{
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
_thickness = Mathf.Max(1f, value);
|
|
66
|
-
UpdateSize();
|
|
67
|
-
MarkDirtyRepaint();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
private float _startAngleDegrees = -90f;
|
|
72
|
-
|
|
73
|
-
public float StartAngleDegrees
|
|
74
|
-
{
|
|
75
|
-
get => _startAngleDegrees;
|
|
76
|
-
set
|
|
77
|
-
{
|
|
78
|
-
if (float.IsNaN(value) || float.IsInfinity(value))
|
|
79
|
-
{
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
_startAngleDegrees = value;
|
|
83
|
-
MarkDirtyRepaint();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
private float _endAngleDegrees = 90f;
|
|
88
|
-
|
|
89
|
-
public float EndAngleDegrees
|
|
90
|
-
{
|
|
91
|
-
get => _endAngleDegrees;
|
|
92
|
-
set
|
|
93
|
-
{
|
|
94
|
-
if (float.IsNaN(value) || float.IsInfinity(value))
|
|
95
|
-
{
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
_endAngleDegrees = value;
|
|
99
|
-
MarkDirtyRepaint();
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
private FillDirection _fillDirection = FillDirection.Forward;
|
|
104
|
-
|
|
105
|
-
public FillDirection Direction
|
|
106
|
-
{
|
|
107
|
-
get => _fillDirection;
|
|
108
|
-
set
|
|
109
|
-
{
|
|
110
|
-
_fillDirection = value;
|
|
111
|
-
MarkDirtyRepaint();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
private bool _roundedCaps = true;
|
|
116
|
-
|
|
117
|
-
public bool RoundedCaps
|
|
118
|
-
{
|
|
119
|
-
get => _roundedCaps;
|
|
120
|
-
set
|
|
121
|
-
{
|
|
122
|
-
_roundedCaps = value;
|
|
123
|
-
MarkDirtyRepaint();
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
private Color _trackColor = Color.gray;
|
|
128
|
-
|
|
129
|
-
public Color TrackColor
|
|
130
|
-
{
|
|
131
|
-
get => _trackColor;
|
|
132
|
-
set
|
|
133
|
-
{
|
|
134
|
-
_trackColor = value;
|
|
135
|
-
MarkDirtyRepaint();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
private Color _progressColor = Color.cyan;
|
|
140
|
-
|
|
141
|
-
public Color ProgressColor
|
|
142
|
-
{
|
|
143
|
-
get => _progressColor;
|
|
144
|
-
set
|
|
145
|
-
{
|
|
146
|
-
_progressColor = value;
|
|
147
|
-
MarkDirtyRepaint();
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
public new class UxmlFactory : UxmlFactory<ArcedProgressBar, UxmlTraits> { }
|
|
152
|
-
|
|
153
|
-
public new class UxmlTraits : VisualElement.UxmlTraits
|
|
154
|
-
{
|
|
155
|
-
private readonly UxmlFloatAttributeDescription _progressAttribute = new()
|
|
156
|
-
{
|
|
157
|
-
name = "progress",
|
|
158
|
-
defaultValue = 0.5f,
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
private readonly UxmlFloatAttributeDescription _radiusAttribute = new()
|
|
162
|
-
{
|
|
163
|
-
name = "radius",
|
|
164
|
-
defaultValue = 50f,
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
private readonly UxmlFloatAttributeDescription _thicknessAttribute = new()
|
|
168
|
-
{
|
|
169
|
-
name = "thickness",
|
|
170
|
-
defaultValue = 10f,
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
private readonly UxmlFloatAttributeDescription _startAngleAttribute = new()
|
|
174
|
-
{
|
|
175
|
-
name = "start-angle",
|
|
176
|
-
defaultValue = -90f,
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
private readonly UxmlFloatAttributeDescription _endAngleAttribute = new()
|
|
180
|
-
{
|
|
181
|
-
name = "end-angle",
|
|
182
|
-
defaultValue = 90f,
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
private readonly UxmlEnumAttributeDescription<FillDirection> _fillDirectionAttribute =
|
|
186
|
-
new() { name = "fill-direction", defaultValue = FillDirection.Forward };
|
|
187
|
-
|
|
188
|
-
private readonly UxmlBoolAttributeDescription _roundedCapsAttribute = new()
|
|
189
|
-
{
|
|
190
|
-
name = "rounded-caps",
|
|
191
|
-
defaultValue = true,
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
private readonly UxmlColorAttributeDescription _trackColorAttribute = new()
|
|
195
|
-
{
|
|
196
|
-
name = "track-color-attr",
|
|
197
|
-
defaultValue = Color.gray,
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
private readonly UxmlColorAttributeDescription _progressColorAttribute = new()
|
|
201
|
-
{
|
|
202
|
-
name = "progress-color-attr",
|
|
203
|
-
defaultValue = Color.cyan,
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
|
|
207
|
-
{
|
|
208
|
-
base.Init(ve, bag, cc);
|
|
209
|
-
if (ve is not ArcedProgressBar bar)
|
|
210
|
-
{
|
|
211
|
-
Debug.LogError(
|
|
212
|
-
$"Initialization failed, expected {nameof(ArcedProgressBar)}, found {ve?.GetType()}.)"
|
|
213
|
-
);
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
bar.Progress = _progressAttribute.GetValueFromBag(bag, cc);
|
|
218
|
-
bar.Radius = _radiusAttribute.GetValueFromBag(bag, cc);
|
|
219
|
-
bar.Thickness = _thicknessAttribute.GetValueFromBag(bag, cc);
|
|
220
|
-
bar.StartAngleDegrees = _startAngleAttribute.GetValueFromBag(bag, cc);
|
|
221
|
-
bar.EndAngleDegrees = _endAngleAttribute.GetValueFromBag(bag, cc);
|
|
222
|
-
bar.Direction = _fillDirectionAttribute.GetValueFromBag(bag, cc);
|
|
223
|
-
bar.RoundedCaps = _roundedCapsAttribute.GetValueFromBag(bag, cc);
|
|
224
|
-
bar.TrackColor = _trackColorAttribute.GetValueFromBag(bag, cc);
|
|
225
|
-
bar.ProgressColor = _progressColorAttribute.GetValueFromBag(bag, cc);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
public ArcedProgressBar()
|
|
230
|
-
{
|
|
231
|
-
AddToClassList(USSClassName);
|
|
232
|
-
generateVisualContent += OnGenerateVisualContent;
|
|
233
|
-
RegisterCallback<CustomStyleResolvedEvent>(OnCustomStyleResolved);
|
|
234
|
-
UpdateSize();
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
private void UpdateSize()
|
|
238
|
-
{
|
|
239
|
-
float diameter = (_radius + _thickness / 2f) * 2f;
|
|
240
|
-
style.width = diameter;
|
|
241
|
-
style.height = diameter;
|
|
242
|
-
style.minWidth = diameter;
|
|
243
|
-
style.minHeight = diameter;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
private void OnCustomStyleResolved(CustomStyleResolvedEvent evt)
|
|
247
|
-
{
|
|
248
|
-
if (
|
|
249
|
-
customStyle.TryGetValue(
|
|
250
|
-
new CustomStyleProperty<Color>(USSTrackColorVarName),
|
|
251
|
-
out Color trackCol
|
|
252
|
-
)
|
|
253
|
-
)
|
|
254
|
-
{
|
|
255
|
-
_trackColor = trackCol;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
if (
|
|
259
|
-
customStyle.TryGetValue(
|
|
260
|
-
new CustomStyleProperty<Color>(USSProgressColorVarName),
|
|
261
|
-
out Color progressCol
|
|
262
|
-
)
|
|
263
|
-
)
|
|
264
|
-
{
|
|
265
|
-
_progressColor = progressCol;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
if (
|
|
269
|
-
customStyle.TryGetValue(
|
|
270
|
-
new CustomStyleProperty<float>(USSThicknessVarName),
|
|
271
|
-
out float thickVal
|
|
272
|
-
)
|
|
273
|
-
)
|
|
274
|
-
{
|
|
275
|
-
_thickness = Mathf.Max(1f, thickVal);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
MarkDirtyRepaint();
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
private void OnGenerateVisualContent(MeshGenerationContext mgc)
|
|
282
|
-
{
|
|
283
|
-
if (_thickness <= 0)
|
|
284
|
-
{
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
Painter2D painter = mgc.painter2D;
|
|
289
|
-
Rect rect = contentRect;
|
|
290
|
-
Vector2 center = rect.center;
|
|
291
|
-
|
|
292
|
-
painter.lineWidth = _thickness;
|
|
293
|
-
painter.lineCap = _roundedCaps ? LineCap.Round : LineCap.Butt;
|
|
294
|
-
|
|
295
|
-
painter.strokeColor = _trackColor;
|
|
296
|
-
painter.BeginPath();
|
|
297
|
-
painter.Arc(center, _radius, _startAngleDegrees, _endAngleDegrees);
|
|
298
|
-
painter.Stroke();
|
|
299
|
-
|
|
300
|
-
if (Mathf.Approximately(_progress, 0f))
|
|
301
|
-
{
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
float startAngle;
|
|
306
|
-
ArcDirection direction;
|
|
307
|
-
float sweepAngleDegrees;
|
|
308
|
-
switch (_fillDirection)
|
|
309
|
-
{
|
|
310
|
-
case FillDirection.Forward:
|
|
311
|
-
{
|
|
312
|
-
startAngle = _startAngleDegrees;
|
|
313
|
-
direction = ArcDirection.Clockwise;
|
|
314
|
-
sweepAngleDegrees =
|
|
315
|
-
_progress * (_endAngleDegrees - _startAngleDegrees).PositiveMod(360f);
|
|
316
|
-
break;
|
|
317
|
-
}
|
|
318
|
-
case FillDirection.Reverse:
|
|
319
|
-
{
|
|
320
|
-
startAngle = _endAngleDegrees;
|
|
321
|
-
direction = ArcDirection.CounterClockwise;
|
|
322
|
-
sweepAngleDegrees =
|
|
323
|
-
-1 * _progress * (_endAngleDegrees - _startAngleDegrees).PositiveMod(360f);
|
|
324
|
-
break;
|
|
325
|
-
}
|
|
326
|
-
default:
|
|
327
|
-
{
|
|
328
|
-
throw new InvalidEnumArgumentException(
|
|
329
|
-
nameof(_fillDirection),
|
|
330
|
-
(int)_fillDirection,
|
|
331
|
-
typeof(FillDirection)
|
|
332
|
-
);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
if (!Mathf.Approximately(sweepAngleDegrees, 0))
|
|
337
|
-
{
|
|
338
|
-
painter.strokeColor = _progressColor;
|
|
339
|
-
painter.BeginPath();
|
|
340
|
-
painter.Arc(center, _radius, startAngle, startAngle + sweepAngleDegrees, direction);
|
|
341
|
-
painter.Stroke();
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
}
|