com.wallstop-studios.unity-helpers 2.0.0-rc73.3 → 2.0.0-rc73.4
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.
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
using UnityEditor;
|
|
10
10
|
using UnityEngine;
|
|
11
11
|
using Core.Extension;
|
|
12
|
+
using Core.Helper;
|
|
12
13
|
|
|
13
14
|
public sealed class AnimationCopierWindow : EditorWindow
|
|
14
15
|
{
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
public string DestinationRelativePath { get; set; }
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
[MenuItem("Tools/Wallstop Studios/Unity Helpers/Animation Copier
|
|
62
|
+
[MenuItem("Tools/Wallstop Studios/Unity Helpers/Animation Copier", priority = -2)]
|
|
62
63
|
public static void ShowWindow()
|
|
63
64
|
{
|
|
64
65
|
GetWindow<AnimationCopierWindow>("Animation Copier");
|
|
@@ -185,7 +186,7 @@
|
|
|
185
186
|
if (newRelPath != null)
|
|
186
187
|
{
|
|
187
188
|
relativePath = newRelPath;
|
|
188
|
-
fullPath = selectedPath.
|
|
189
|
+
fullPath = selectedPath.SanitizePath();
|
|
189
190
|
EditorPrefs.SetString(prefKey, relativePath);
|
|
190
191
|
this.Log($"{label} set to: {relativePath}");
|
|
191
192
|
ValidatePaths();
|
|
@@ -460,7 +461,7 @@
|
|
|
460
461
|
FileName = Path.GetFileName(sourceRelPath),
|
|
461
462
|
RelativeDirectory = GetRelativeSubPath(
|
|
462
463
|
_animationSourcePathRelative,
|
|
463
|
-
directoryName.
|
|
464
|
+
directoryName.SanitizePath()
|
|
464
465
|
),
|
|
465
466
|
Hash = CalculateFileHash(sourceFullPath),
|
|
466
467
|
};
|
|
@@ -469,7 +470,7 @@
|
|
|
469
470
|
fileInfo.RelativeDirectory,
|
|
470
471
|
fileInfo.FileName
|
|
471
472
|
)
|
|
472
|
-
.
|
|
473
|
+
.SanitizePath();
|
|
473
474
|
_sourceAnimations.Add(fileInfo);
|
|
474
475
|
|
|
475
476
|
EditorUtility.DisplayProgressBar(
|
|
@@ -615,7 +616,8 @@
|
|
|
615
616
|
|
|
616
617
|
string sourceAssetPath = animInfo.RelativePath;
|
|
617
618
|
string destinationAssetPath = animInfo.DestinationRelativePath;
|
|
618
|
-
string destDirectory = Path.GetDirectoryName(destinationAssetPath)
|
|
619
|
+
string destDirectory = Path.GetDirectoryName(destinationAssetPath)
|
|
620
|
+
.SanitizePath();
|
|
619
621
|
|
|
620
622
|
if (
|
|
621
623
|
!string.IsNullOrEmpty(destDirectory)
|
|
@@ -784,7 +786,7 @@
|
|
|
784
786
|
return null;
|
|
785
787
|
}
|
|
786
788
|
|
|
787
|
-
fullPath = fullPath.
|
|
789
|
+
fullPath = fullPath.SanitizePath();
|
|
788
790
|
if (
|
|
789
791
|
fullPath.EndsWith("/Assets", StringComparison.OrdinalIgnoreCase)
|
|
790
792
|
&& Path.GetFileName(fullPath).Equals("Assets", StringComparison.OrdinalIgnoreCase)
|
|
@@ -793,7 +795,7 @@
|
|
|
793
795
|
return "Assets";
|
|
794
796
|
}
|
|
795
797
|
|
|
796
|
-
string assetsPath = Application.dataPath.
|
|
798
|
+
string assetsPath = Application.dataPath.SanitizePath();
|
|
797
799
|
if (fullPath.StartsWith(assetsPath, StringComparison.OrdinalIgnoreCase))
|
|
798
800
|
{
|
|
799
801
|
if (fullPath.Length == assetsPath.Length)
|
|
@@ -828,7 +830,7 @@
|
|
|
828
830
|
|
|
829
831
|
if (relativePath.Equals("Assets", StringComparison.OrdinalIgnoreCase))
|
|
830
832
|
{
|
|
831
|
-
return Application.dataPath.
|
|
833
|
+
return Application.dataPath.SanitizePath();
|
|
832
834
|
}
|
|
833
835
|
|
|
834
836
|
if (relativePath.StartsWith("Assets/", StringComparison.OrdinalIgnoreCase))
|
|
@@ -837,7 +839,7 @@
|
|
|
837
839
|
0,
|
|
838
840
|
Application.dataPath.Length - "Assets".Length
|
|
839
841
|
);
|
|
840
|
-
return (projectRoot + relativePath).
|
|
842
|
+
return (projectRoot + relativePath).SanitizePath();
|
|
841
843
|
}
|
|
842
844
|
return null;
|
|
843
845
|
}
|
|
@@ -920,8 +922,7 @@
|
|
|
920
922
|
return;
|
|
921
923
|
}
|
|
922
924
|
|
|
923
|
-
string parentPath = Path.GetDirectoryName(relativeDirectoryPath)
|
|
924
|
-
?.Replace(Path.DirectorySeparatorChar, '/');
|
|
925
|
+
string parentPath = Path.GetDirectoryName(relativeDirectoryPath).SanitizePath();
|
|
925
926
|
|
|
926
927
|
if (
|
|
927
928
|
string.IsNullOrEmpty(parentPath)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
using System.Runtime.CompilerServices;
|
|
2
2
|
|
|
3
3
|
[assembly: InternalsVisibleTo(assemblyName: "WallstopStudios.UnityHelpers.Styles")]
|
|
4
|
+
[assembly: InternalsVisibleTo(assemblyName: "WallstopStudios.UnityHelpers.Editor")]
|
|
4
5
|
|
|
5
6
|
namespace WallstopStudios.UnityHelpers.Core.Helper
|
|
6
7
|
{
|
|
@@ -8,7 +9,7 @@ namespace WallstopStudios.UnityHelpers.Core.Helper
|
|
|
8
9
|
{
|
|
9
10
|
public static string SanitizePath(this string path)
|
|
10
11
|
{
|
|
11
|
-
return path
|
|
12
|
+
return path?.Replace('\\', '/');
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
}
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
Vertical = 1,
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
public const string
|
|
17
|
-
public const string
|
|
18
|
-
public const string
|
|
19
|
-
public const string
|
|
20
|
-
public const string
|
|
21
|
-
public const string
|
|
22
|
-
public const string
|
|
23
|
-
public const string
|
|
24
|
-
public const string
|
|
25
|
-
public const string
|
|
16
|
+
public const string USSClassName = "marching-ants-progress-bar";
|
|
17
|
+
public const string USSTrackClassName = USSClassName + "__track";
|
|
18
|
+
public const string USSFillContainerClassName = USSClassName + "__fill-container";
|
|
19
|
+
public const string USSFillClassName = USSClassName + "__fill";
|
|
20
|
+
public const string USSTrackColorVarName = "--ants-track-color";
|
|
21
|
+
public const string USSProgressColorVarName = "--ants-progress-color";
|
|
22
|
+
public const string USSThicknessVarName = "--ants-thickness";
|
|
23
|
+
public const string USSBorderRadiusVarName = "--ants-border-radius";
|
|
24
|
+
public const string USSDashOnVarName = "--ants-dash-on";
|
|
25
|
+
public const string USSDashOffVarName = "--ants-dash-off";
|
|
26
26
|
|
|
27
27
|
private readonly VisualElement _trackElement;
|
|
28
28
|
private readonly VisualElement _fillContainer;
|
|
@@ -288,9 +288,9 @@
|
|
|
288
288
|
|
|
289
289
|
public MarchingAntsProgressBar()
|
|
290
290
|
{
|
|
291
|
-
AddToClassList(
|
|
291
|
+
AddToClassList(USSClassName);
|
|
292
292
|
_trackElement = new VisualElement { name = "track", pickingMode = PickingMode.Ignore };
|
|
293
|
-
_trackElement.AddToClassList(
|
|
293
|
+
_trackElement.AddToClassList(USSTrackClassName);
|
|
294
294
|
_trackElement.style.position = Position.Absolute;
|
|
295
295
|
_trackElement.style.left = 0;
|
|
296
296
|
_trackElement.style.top = 0;
|
|
@@ -303,7 +303,7 @@
|
|
|
303
303
|
name = "fill-container",
|
|
304
304
|
pickingMode = PickingMode.Ignore,
|
|
305
305
|
};
|
|
306
|
-
_fillContainer.AddToClassList(
|
|
306
|
+
_fillContainer.AddToClassList(USSFillContainerClassName);
|
|
307
307
|
_fillContainer.style.overflow = Overflow.Hidden;
|
|
308
308
|
_fillContainer.style.position = Position.Absolute;
|
|
309
309
|
_fillContainer.style.left = 0;
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
_fillContainer.style.height = Length.Percent(100);
|
|
313
313
|
Add(_fillContainer);
|
|
314
314
|
_fillElement = new VisualElement { name = "fill", pickingMode = PickingMode.Ignore };
|
|
315
|
-
_fillElement.AddToClassList(
|
|
315
|
+
_fillElement.AddToClassList(USSFillClassName);
|
|
316
316
|
_fillElement.style.position = Position.Absolute;
|
|
317
317
|
_fillElement.style.left = 0;
|
|
318
318
|
_fillElement.style.top = 0;
|
|
@@ -453,7 +453,7 @@
|
|
|
453
453
|
{
|
|
454
454
|
if (
|
|
455
455
|
customStyle.TryGetValue(
|
|
456
|
-
new CustomStyleProperty<Color>(
|
|
456
|
+
new CustomStyleProperty<Color>(USSTrackColorVarName),
|
|
457
457
|
out Color tc
|
|
458
458
|
)
|
|
459
459
|
)
|
|
@@ -463,7 +463,7 @@
|
|
|
463
463
|
|
|
464
464
|
if (
|
|
465
465
|
customStyle.TryGetValue(
|
|
466
|
-
new CustomStyleProperty<Color>(
|
|
466
|
+
new CustomStyleProperty<Color>(USSProgressColorVarName),
|
|
467
467
|
out Color pc
|
|
468
468
|
)
|
|
469
469
|
)
|
|
@@ -473,7 +473,7 @@
|
|
|
473
473
|
|
|
474
474
|
if (
|
|
475
475
|
customStyle.TryGetValue(
|
|
476
|
-
new CustomStyleProperty<float>(
|
|
476
|
+
new CustomStyleProperty<float>(USSThicknessVarName),
|
|
477
477
|
out float th
|
|
478
478
|
)
|
|
479
479
|
)
|
|
@@ -483,7 +483,7 @@
|
|
|
483
483
|
|
|
484
484
|
if (
|
|
485
485
|
customStyle.TryGetValue(
|
|
486
|
-
new CustomStyleProperty<float>(
|
|
486
|
+
new CustomStyleProperty<float>(USSBorderRadiusVarName),
|
|
487
487
|
out float br
|
|
488
488
|
)
|
|
489
489
|
)
|
|
@@ -493,7 +493,7 @@
|
|
|
493
493
|
|
|
494
494
|
if (
|
|
495
495
|
customStyle.TryGetValue(
|
|
496
|
-
new CustomStyleProperty<float>(
|
|
496
|
+
new CustomStyleProperty<float>(USSDashOnVarName),
|
|
497
497
|
out float don
|
|
498
498
|
)
|
|
499
499
|
)
|
|
@@ -503,7 +503,7 @@
|
|
|
503
503
|
|
|
504
504
|
if (
|
|
505
505
|
customStyle.TryGetValue(
|
|
506
|
-
new CustomStyleProperty<float>(
|
|
506
|
+
new CustomStyleProperty<float>(USSDashOffVarName),
|
|
507
507
|
out float doff
|
|
508
508
|
)
|
|
509
509
|
)
|
package/package.json
CHANGED