com.wallstop-studios.unity-helpers 2.0.0-rc73.19 → 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/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/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/MarchingAntsProgressBar.cs +20 -20
- 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 -930
- package/Editor/Sprites/ScriptableSpriteAtlasEditor.cs.meta +0 -3
- package/Editor/Sprites.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
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
namespace WallstopStudios.UnityHelpers.Editor
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Editor
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
|
+
using Core.Extension;
|
|
4
5
|
using System;
|
|
5
6
|
using System.Collections.Generic;
|
|
6
7
|
using System.IO;
|
|
@@ -8,9 +9,6 @@
|
|
|
8
9
|
using System.Text.RegularExpressions;
|
|
9
10
|
using UnityEditor;
|
|
10
11
|
using UnityEngine;
|
|
11
|
-
using Core.Extension;
|
|
12
|
-
using Core.Helper;
|
|
13
|
-
using CustomEditors;
|
|
14
12
|
using Object = UnityEngine.Object;
|
|
15
13
|
|
|
16
14
|
[Serializable]
|
|
@@ -27,8 +25,6 @@
|
|
|
27
25
|
|
|
28
26
|
public sealed class AnimationCreatorWindow : EditorWindow
|
|
29
27
|
{
|
|
30
|
-
private static readonly char[] WhiteSpaceSplitters = { ' ', '\t', '\n', '\r' };
|
|
31
|
-
|
|
32
28
|
private SerializedObject _serializedObject;
|
|
33
29
|
private SerializedProperty _animationDataProp;
|
|
34
30
|
private SerializedProperty _animationSourcesProp;
|
|
@@ -78,13 +74,12 @@
|
|
|
78
74
|
_scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition);
|
|
79
75
|
|
|
80
76
|
EditorGUILayout.LabelField("Configuration", EditorStyles.boldLabel);
|
|
81
|
-
|
|
82
|
-
_animationSourcesProp,
|
|
83
|
-
nameof(AnimationCreatorWindow)
|
|
84
|
-
);
|
|
77
|
+
EditorGUILayout.PropertyField(_animationSourcesProp, true);
|
|
85
78
|
EditorGUILayout.PropertyField(_spriteNameRegexProp);
|
|
86
79
|
EditorGUILayout.PropertyField(_textProp);
|
|
87
80
|
|
|
81
|
+
DrawAddSourceFolderButton();
|
|
82
|
+
|
|
88
83
|
if (!string.IsNullOrWhiteSpace(_errorMessage))
|
|
89
84
|
{
|
|
90
85
|
EditorGUILayout.HelpBox(_errorMessage, MessageType.Error);
|
|
@@ -92,7 +87,7 @@
|
|
|
92
87
|
else if (
|
|
93
88
|
_animationSourcesProp.arraySize == 0
|
|
94
89
|
|| _animationSourcesProp.FindPropertyRelative("Array.size").intValue == 0
|
|
95
|
-
|| animationSources.TrueForAll(
|
|
90
|
+
|| animationSources.TrueForAll(s => s == null)
|
|
96
91
|
)
|
|
97
92
|
{
|
|
98
93
|
EditorGUILayout.HelpBox(
|
|
@@ -123,6 +118,78 @@
|
|
|
123
118
|
_ = _serializedObject.ApplyModifiedProperties();
|
|
124
119
|
}
|
|
125
120
|
|
|
121
|
+
private void DrawAddSourceFolderButton()
|
|
122
|
+
{
|
|
123
|
+
if (!GUILayout.Button("Add Source Folder..."))
|
|
124
|
+
{
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
string absolutePath = EditorUtility.OpenFolderPanel(
|
|
129
|
+
"Select Animation Source Folder",
|
|
130
|
+
"Assets",
|
|
131
|
+
""
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
if (string.IsNullOrWhiteSpace(absolutePath))
|
|
135
|
+
{
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
absolutePath = absolutePath.Replace("\\", "/");
|
|
140
|
+
if (absolutePath.StartsWith(Application.dataPath, StringComparison.OrdinalIgnoreCase))
|
|
141
|
+
{
|
|
142
|
+
string relativePath =
|
|
143
|
+
"Assets" + absolutePath.Substring(Application.dataPath.Length);
|
|
144
|
+
|
|
145
|
+
DefaultAsset folderAsset = AssetDatabase.LoadAssetAtPath<DefaultAsset>(
|
|
146
|
+
relativePath
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
if (folderAsset != null && AssetDatabase.IsValidFolder(relativePath))
|
|
150
|
+
{
|
|
151
|
+
bool alreadyExists = false;
|
|
152
|
+
for (int i = 0; i < _animationSourcesProp.arraySize; ++i)
|
|
153
|
+
{
|
|
154
|
+
if (
|
|
155
|
+
_animationSourcesProp.GetArrayElementAtIndex(i).objectReferenceValue
|
|
156
|
+
== folderAsset
|
|
157
|
+
)
|
|
158
|
+
{
|
|
159
|
+
alreadyExists = true;
|
|
160
|
+
this.LogWarn($"Folder '{relativePath}' is already in the list.");
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (!alreadyExists)
|
|
166
|
+
{
|
|
167
|
+
_animationSourcesProp.arraySize++;
|
|
168
|
+
_animationSourcesProp
|
|
169
|
+
.GetArrayElementAtIndex(_animationSourcesProp.arraySize - 1)
|
|
170
|
+
.objectReferenceValue = folderAsset;
|
|
171
|
+
this.Log($"Added source folder: {relativePath}");
|
|
172
|
+
|
|
173
|
+
_serializedObject.ApplyModifiedProperties();
|
|
174
|
+
FindAndFilterSprites();
|
|
175
|
+
Repaint();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
else
|
|
179
|
+
{
|
|
180
|
+
this.LogError(
|
|
181
|
+
$"Could not load folder asset at path: {relativePath}. Is it a valid folder within the project?"
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else
|
|
186
|
+
{
|
|
187
|
+
this.LogError(
|
|
188
|
+
$"Selected folder must be inside the project's Assets folder. Path selected: {absolutePath}"
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
126
193
|
private void DrawCheckSpritesButton()
|
|
127
194
|
{
|
|
128
195
|
if (GUILayout.Button("Check/Refresh Filtered Sprites"))
|
|
@@ -138,7 +205,10 @@
|
|
|
138
205
|
int listSize = _animationDataProp.arraySize;
|
|
139
206
|
string[] searchTerms = string.IsNullOrWhiteSpace(_searchString)
|
|
140
207
|
? Array.Empty<string>()
|
|
141
|
-
: _searchString.Split(
|
|
208
|
+
: _searchString.Split(
|
|
209
|
+
new[] { ' ', '\t', '\n', '\r' },
|
|
210
|
+
StringSplitOptions.RemoveEmptyEntries
|
|
211
|
+
);
|
|
142
212
|
|
|
143
213
|
List<int> matchingIndices = new();
|
|
144
214
|
for (int i = 0; i < listSize; ++i)
|
|
@@ -175,7 +245,7 @@
|
|
|
175
245
|
|
|
176
246
|
if (_animationDataIsExpanded)
|
|
177
247
|
{
|
|
178
|
-
|
|
248
|
+
EditorGUI.indentLevel++;
|
|
179
249
|
if (matchCount > 0)
|
|
180
250
|
{
|
|
181
251
|
foreach (int index in matchingIndices)
|
|
@@ -203,6 +273,8 @@
|
|
|
203
273
|
MessageType.Info
|
|
204
274
|
);
|
|
205
275
|
}
|
|
276
|
+
|
|
277
|
+
EditorGUI.indentLevel--;
|
|
206
278
|
}
|
|
207
279
|
}
|
|
208
280
|
|
|
@@ -266,13 +338,6 @@
|
|
|
266
338
|
}
|
|
267
339
|
}
|
|
268
340
|
|
|
269
|
-
if (GUILayout.Button("Create new Animation Data"))
|
|
270
|
-
{
|
|
271
|
-
animationData.Add(new AnimationData());
|
|
272
|
-
_serializedObject.Update();
|
|
273
|
-
Repaint();
|
|
274
|
-
}
|
|
275
|
-
|
|
276
341
|
if (_filteredSprites.Count == 0)
|
|
277
342
|
{
|
|
278
343
|
EditorGUILayout.HelpBox(
|
|
@@ -374,14 +439,14 @@
|
|
|
374
439
|
}
|
|
375
440
|
|
|
376
441
|
EditorGUILayout.Space();
|
|
377
|
-
using (new EditorGUI.DisabledScope(animationData
|
|
442
|
+
using (new EditorGUI.DisabledScope(animationData == null || animationData.Count == 0))
|
|
378
443
|
{
|
|
379
444
|
if (GUILayout.Button("Create Animations"))
|
|
380
445
|
{
|
|
381
446
|
CreateAnimations();
|
|
382
447
|
}
|
|
383
448
|
}
|
|
384
|
-
if (animationData
|
|
449
|
+
if (animationData == null || animationData.Count == 0)
|
|
385
450
|
{
|
|
386
451
|
EditorGUILayout.HelpBox(
|
|
387
452
|
"Add Animation Data entries before creating.",
|
|
@@ -392,7 +457,7 @@
|
|
|
392
457
|
|
|
393
458
|
private void CreateAnimations()
|
|
394
459
|
{
|
|
395
|
-
if (animationData is not { Count:
|
|
460
|
+
if (animationData is not { Count: not 0 })
|
|
396
461
|
{
|
|
397
462
|
this.LogError($"No animation data to create.");
|
|
398
463
|
return;
|
|
@@ -467,7 +532,7 @@
|
|
|
467
532
|
}
|
|
468
533
|
|
|
469
534
|
List<Sprite> frames = data.frames;
|
|
470
|
-
if (frames is not { Count:
|
|
535
|
+
if (frames is not { Count: not 0 })
|
|
471
536
|
{
|
|
472
537
|
this.LogWarn(
|
|
473
538
|
$"Ignoring animation '{animationName}' because it has no frames."
|
|
@@ -531,7 +596,7 @@
|
|
|
531
596
|
|
|
532
597
|
string firstFramePath = AssetDatabase.GetAssetPath(validFrames[0]);
|
|
533
598
|
string assetPath =
|
|
534
|
-
Path.GetDirectoryName(firstFramePath)
|
|
599
|
+
Path.GetDirectoryName(firstFramePath)?.Replace("\\", "/") ?? "Assets";
|
|
535
600
|
if (!assetPath.EndsWith("/"))
|
|
536
601
|
{
|
|
537
602
|
assetPath += "/";
|
|
@@ -594,7 +659,7 @@
|
|
|
594
659
|
_matchedSpriteCount = 0;
|
|
595
660
|
_unmatchedSpriteCount = 0;
|
|
596
661
|
|
|
597
|
-
if (animationSources is not { Count:
|
|
662
|
+
if (animationSources is not { Count: not 0 } || _compiledRegex == null)
|
|
598
663
|
{
|
|
599
664
|
if (_compiledRegex == null && !string.IsNullOrWhiteSpace(spriteNameRegex))
|
|
600
665
|
{
|
|
@@ -602,7 +667,7 @@
|
|
|
602
667
|
$"Cannot find sprites, regex pattern '{spriteNameRegex}' is invalid."
|
|
603
668
|
);
|
|
604
669
|
}
|
|
605
|
-
else if (animationSources is not { Count:
|
|
670
|
+
else if (animationSources is not { Count: not 0 })
|
|
606
671
|
{
|
|
607
672
|
this.LogWarn($"Cannot find sprites, no animation sources specified.");
|
|
608
673
|
}
|
|
@@ -610,8 +675,13 @@
|
|
|
610
675
|
}
|
|
611
676
|
|
|
612
677
|
List<string> searchPaths = new();
|
|
613
|
-
foreach (Object source in animationSources
|
|
678
|
+
foreach (Object source in animationSources)
|
|
614
679
|
{
|
|
680
|
+
if (source == null)
|
|
681
|
+
{
|
|
682
|
+
continue;
|
|
683
|
+
}
|
|
684
|
+
|
|
615
685
|
string path = AssetDatabase.GetAssetPath(source);
|
|
616
686
|
if (!string.IsNullOrWhiteSpace(path) && AssetDatabase.IsValidFolder(path))
|
|
617
687
|
{
|
|
@@ -711,7 +781,8 @@
|
|
|
711
781
|
}
|
|
712
782
|
|
|
713
783
|
string assetPath = AssetDatabase.GetAssetPath(sprite);
|
|
714
|
-
string directoryPath =
|
|
784
|
+
string directoryPath =
|
|
785
|
+
Path.GetDirectoryName(assetPath)?.Replace("\\", "/") ?? "";
|
|
715
786
|
string frameName = sprite.name;
|
|
716
787
|
|
|
717
788
|
int splitIndex = frameName.LastIndexOf('_');
|
|
@@ -172,15 +172,16 @@
|
|
|
172
172
|
|
|
173
173
|
DrawSpritePreview(item);
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
EditorGUI.indentLevel++;
|
|
176
|
+
RenderAnimationEventItem(item, frame, frameRate);
|
|
177
|
+
|
|
178
|
+
if (i != stateCopy.Count - 1)
|
|
176
179
|
{
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
{
|
|
180
|
-
DrawGuiLine(height: 3, color: new Color(0f, 1f, 0.3f, 1f));
|
|
181
|
-
EditorGUILayout.Space();
|
|
182
|
-
}
|
|
180
|
+
DrawGuiLine(height: 3, color: new Color(0f, 1f, 0.3f, 1f));
|
|
181
|
+
EditorGUILayout.Space();
|
|
183
182
|
}
|
|
183
|
+
|
|
184
|
+
EditorGUI.indentLevel--;
|
|
184
185
|
}
|
|
185
186
|
|
|
186
187
|
EditorGUILayout.EndScrollView();
|
|
@@ -319,7 +320,8 @@
|
|
|
319
320
|
private void RenderAnimationEventItem(AnimationEventItem item, int frame, float frameRate)
|
|
320
321
|
{
|
|
321
322
|
int index = _state.IndexOf(item);
|
|
322
|
-
|
|
323
|
+
EditorGUILayout.BeginHorizontal();
|
|
324
|
+
try
|
|
323
325
|
{
|
|
324
326
|
if (
|
|
325
327
|
1 <= index
|
|
@@ -367,6 +369,10 @@
|
|
|
367
369
|
return;
|
|
368
370
|
}
|
|
369
371
|
}
|
|
372
|
+
finally
|
|
373
|
+
{
|
|
374
|
+
EditorGUILayout.EndHorizontal();
|
|
375
|
+
}
|
|
370
376
|
|
|
371
377
|
IReadOnlyDictionary<Type, IReadOnlyList<MethodInfo>> lookup = FilterLookup(item);
|
|
372
378
|
|
|
@@ -535,7 +541,7 @@
|
|
|
535
541
|
ParameterInfo[] arrayParameterInfo = item.selectedMethod.GetParameters();
|
|
536
542
|
if (arrayParameterInfo.Length == 1)
|
|
537
543
|
{
|
|
538
|
-
|
|
544
|
+
EditorGUI.indentLevel++;
|
|
539
545
|
|
|
540
546
|
Type paramType = arrayParameterInfo[0].ParameterType;
|
|
541
547
|
if (paramType == typeof(int))
|
|
@@ -596,6 +602,8 @@
|
|
|
596
602
|
true
|
|
597
603
|
);
|
|
598
604
|
}
|
|
605
|
+
|
|
606
|
+
EditorGUI.indentLevel--;
|
|
599
607
|
}
|
|
600
608
|
}
|
|
601
609
|
|
|
@@ -678,7 +686,8 @@
|
|
|
678
686
|
}
|
|
679
687
|
else if (!item.isTextureReadable && !string.IsNullOrEmpty(spriteName))
|
|
680
688
|
{
|
|
681
|
-
|
|
689
|
+
EditorGUILayout.BeginHorizontal();
|
|
690
|
+
try
|
|
682
691
|
{
|
|
683
692
|
GUILayout.Label($"Sprite '{spriteName}' required \"Read/Write\" enabled");
|
|
684
693
|
if (item.sprite != null && GUILayout.Button("Fix"))
|
|
@@ -702,6 +711,10 @@
|
|
|
702
711
|
EditorUtility.SetDirty(item.sprite);
|
|
703
712
|
}
|
|
704
713
|
}
|
|
714
|
+
finally
|
|
715
|
+
{
|
|
716
|
+
EditorGUILayout.EndHorizontal();
|
|
717
|
+
}
|
|
705
718
|
}
|
|
706
719
|
else if (item.isInvalidTextureRect && !string.IsNullOrEmpty(spriteName))
|
|
707
720
|
{
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
using UnityEditor;
|
|
8
8
|
using UnityEngine;
|
|
9
9
|
using Core.Extension;
|
|
10
|
-
using CustomEditors;
|
|
11
10
|
using Object = UnityEngine.Object;
|
|
12
11
|
|
|
13
12
|
public enum FitMode
|
|
@@ -41,7 +40,7 @@
|
|
|
41
40
|
nameof(_textureSourcePaths)
|
|
42
41
|
);
|
|
43
42
|
|
|
44
|
-
if (_textureSourcePaths
|
|
43
|
+
if (_textureSourcePaths != null && _textureSourcePaths.Count != 0)
|
|
45
44
|
{
|
|
46
45
|
return;
|
|
47
46
|
}
|
|
@@ -66,10 +65,50 @@
|
|
|
66
65
|
_fitMode = (FitMode)EditorGUILayout.EnumPopup("Fit Mode", _fitMode);
|
|
67
66
|
|
|
68
67
|
EditorGUILayout.Space();
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
EditorGUILayout.LabelField("Source Folders", EditorStyles.boldLabel);
|
|
69
|
+
|
|
70
|
+
if (GUILayout.Button("Add Source Directory"))
|
|
71
|
+
{
|
|
72
|
+
string path = EditorUtility.OpenFolderPanel(
|
|
73
|
+
"Select Texture Source Directory",
|
|
74
|
+
"Assets",
|
|
75
|
+
""
|
|
76
|
+
);
|
|
77
|
+
if (!string.IsNullOrWhiteSpace(path))
|
|
78
|
+
{
|
|
79
|
+
if (path.StartsWith(Application.dataPath))
|
|
80
|
+
{
|
|
81
|
+
string relativePath =
|
|
82
|
+
"Assets" + path.Substring(Application.dataPath.Length);
|
|
83
|
+
Object folderObject = AssetDatabase.LoadAssetAtPath<Object>(relativePath);
|
|
84
|
+
if (folderObject != null)
|
|
85
|
+
{
|
|
86
|
+
_textureSourcePaths ??= new List<Object>();
|
|
87
|
+
if (!_textureSourcePaths.Contains(folderObject))
|
|
88
|
+
{
|
|
89
|
+
_textureSourcePaths.Add(folderObject);
|
|
90
|
+
_potentialChangeCount = -1;
|
|
91
|
+
}
|
|
92
|
+
else
|
|
93
|
+
{
|
|
94
|
+
this.LogWarn($"Directory '{relativePath}' is already in the list.");
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else
|
|
98
|
+
{
|
|
99
|
+
this.LogError($"Could not load asset at path: '{relativePath}'");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
else
|
|
103
|
+
{
|
|
104
|
+
this.LogError(
|
|
105
|
+
$"Selected path is outside the project's Assets folder: '{path}'"
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
EditorGUILayout.PropertyField(_textureSourcePathsProperty, true);
|
|
73
112
|
EditorGUILayout.Space();
|
|
74
113
|
EditorGUILayout.LabelField("Actions", EditorStyles.boldLabel);
|
|
75
114
|
|
|
@@ -297,14 +336,6 @@
|
|
|
297
336
|
_ = updatedImporters.Remove(textureImporter);
|
|
298
337
|
}
|
|
299
338
|
}
|
|
300
|
-
}
|
|
301
|
-
finally
|
|
302
|
-
{
|
|
303
|
-
if (applyChanges)
|
|
304
|
-
{
|
|
305
|
-
AssetDatabase.StopAssetEditing();
|
|
306
|
-
}
|
|
307
|
-
EditorUtility.ClearProgressBar();
|
|
308
339
|
|
|
309
340
|
if (applyChanges)
|
|
310
341
|
{
|
|
@@ -325,6 +356,14 @@
|
|
|
325
356
|
}
|
|
326
357
|
}
|
|
327
358
|
}
|
|
359
|
+
finally
|
|
360
|
+
{
|
|
361
|
+
if (applyChanges)
|
|
362
|
+
{
|
|
363
|
+
AssetDatabase.StopAssetEditing();
|
|
364
|
+
}
|
|
365
|
+
EditorUtility.ClearProgressBar();
|
|
366
|
+
}
|
|
328
367
|
return changedCount;
|
|
329
368
|
}
|
|
330
369
|
}
|
package/Editor/PrefabChecker.cs
CHANGED
|
@@ -148,16 +148,23 @@
|
|
|
148
148
|
GUI.enabled = wasEnabled && _checkNullObjectReferences;
|
|
149
149
|
try
|
|
150
150
|
{
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
151
|
+
EditorGUI.indentLevel++;
|
|
152
|
+
try
|
|
153
|
+
{
|
|
154
|
+
DrawAndAlign(
|
|
155
|
+
new GUIContent(
|
|
156
|
+
"Only if [ValidateAssignment]",
|
|
157
|
+
"Only report null object references if the field has the [ValidateAssignment] attribute."
|
|
158
|
+
),
|
|
159
|
+
() => _onlyCheckNullObjectsWithAttribute,
|
|
160
|
+
v => _onlyCheckNullObjectsWithAttribute = v,
|
|
161
|
+
true
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
finally
|
|
165
|
+
{
|
|
166
|
+
EditorGUI.indentLevel--;
|
|
167
|
+
}
|
|
161
168
|
}
|
|
162
169
|
finally
|
|
163
170
|
{
|
|
@@ -367,7 +374,7 @@
|
|
|
367
374
|
|
|
368
375
|
private void RunChecks()
|
|
369
376
|
{
|
|
370
|
-
if (_assetPaths
|
|
377
|
+
if (_assetPaths == null || _assetPaths.Count == 0)
|
|
371
378
|
{
|
|
372
379
|
this.LogError($"No asset paths specified. Add folders containing prefabs.");
|
|
373
380
|
return;
|