com.wallstop-studios.unity-helpers 2.0.0-rc61 → 2.0.0-rc63
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/AnimationCopier.cs +7 -14
- package/Editor/AnimationCreator.cs +7 -11
- package/Editor/AnimationEventEditor.cs +6 -6
- package/Editor/AnimatorControllerCopier.cs +7 -13
- package/Editor/CustomEditors/MatchColliderToSpriteEditor.cs +4 -6
- package/Editor/FitTextureSizeWizard.cs +4 -4
- package/Editor/PrefabCheckWizard.cs +10 -13
- package/Editor/SpriteSettingsApplier.cs +4 -4
- package/Editor/StringInListeDrawer.cs +2 -2
- package/Editor/TextureResizerWizard.cs +6 -12
- package/Editor/TextureSettingsApplier.cs +5 -5
- package/Editor/Utils/DxReadOnlyPropertyDrawer.cs +2 -2
- package/Editor/Utils/EditorUtilities.cs +1 -1
- package/Editor/WShowIfPropertyDrawer.cs +4 -4
- package/Editor/WallstopStudios.UnityHelpers.Editor.asmdef +1 -1
- package/Runtime/Core/Attributes/AnimationEventAttribute.cs +1 -1
- package/Runtime/Core/Attributes/ChildComponentAttribute.cs +2 -1
- package/Runtime/Core/Attributes/DxReadOnlyAttribute.cs +1 -1
- package/Runtime/Core/Attributes/KSerializableAttribute.cs +1 -1
- package/Runtime/Core/Attributes/NotNullAttribute.cs +1 -1
- package/Runtime/Core/Attributes/ParentComponent.cs +1 -1
- package/Runtime/Core/Attributes/RelationalComponentExtensions.cs +1 -1
- package/Runtime/Core/Attributes/SiblingComponentAttribute.cs +1 -1
- package/Runtime/Core/Attributes/ValidateAssignmentAttribute.cs +12 -7
- package/Runtime/Core/Attributes/WShowIfAttribute.cs +1 -1
- package/Runtime/Core/DataStructure/Adapters/FastVector2Int.cs +1 -1
- package/Runtime/Core/DataStructure/Adapters/FastVector3Int.cs +1 -1
- package/Runtime/Core/DataStructure/Adapters/KGuid.cs +1 -1
- package/Runtime/Core/DataStructure/Adapters/KVector2.cs +1 -1
- package/Runtime/Core/DataStructure/Circle.cs +1 -1
- package/Runtime/Core/DataStructure/CyclicBuffer.cs +1 -1
- package/Runtime/Core/DataStructure/ISpatialTree.cs +1 -1
- package/Runtime/Core/DataStructure/KDTree.cs +1 -1
- package/Runtime/Core/DataStructure/QuadTree.cs +1 -1
- package/Runtime/Core/DataStructure/RTree.cs +1 -1
- package/Runtime/Core/DataStructure/StringWrapper.cs +1 -1
- package/Runtime/Core/DataStructure/TimedCache.cs +1 -1
- package/Runtime/Core/Extension/AnimatorExtensions.cs +1 -1
- package/Runtime/Core/Extension/AsyncOperationExtensions.cs +1 -1
- package/Runtime/Core/Extension/CircleExtensions.cs +1 -1
- package/Runtime/Core/Extension/ColorExtensions.cs +16 -1
- package/Runtime/Core/Extension/DictionaryExtensions.cs +1 -1
- package/Runtime/Core/Extension/DirectionExtensions.cs +1 -1
- package/Runtime/Core/Extension/EnumExtensions.cs +1 -1
- package/Runtime/Core/Extension/HashSetExtensions.cs +1 -1
- package/Runtime/Core/Extension/IEnumerableExtensions.cs +1 -1
- package/Runtime/Core/Extension/IListExtensions.cs +1 -1
- package/Runtime/Core/Extension/LoggingExtensions.cs +69 -122
- package/Runtime/Core/Extension/RandomExtensions.cs +1 -1
- package/Runtime/Core/Extension/SerializedPropertyExtensions.cs +2 -2
- package/Runtime/Core/Extension/StringExtensions.cs +1 -1
- package/Runtime/Core/Extension/UnityExtensions.cs +1 -2
- package/Runtime/Core/Helper/ArrayConverter.cs +1 -1
- package/Runtime/Core/Helper/AssignUtilities.cs +1 -1
- package/Runtime/Core/Helper/DirectoryHelper.cs +1 -1
- package/Runtime/Core/Helper/Enumerables.cs +1 -1
- package/Runtime/Core/Helper/FormattingHelpers.cs +1 -1
- package/Runtime/Core/Helper/Geometry.cs +1 -1
- package/Runtime/Core/Helper/Helpers.cs +6 -9
- package/Runtime/Core/Helper/IterationHelpers.cs +1 -1
- package/Runtime/Core/Helper/LifetimeHelpers.cs +2 -1
- package/Runtime/Core/Helper/Logging/UnityLogTagFormatter.cs +517 -0
- package/Runtime/Core/Helper/Logging/UnityLogTagFormatter.cs.meta +3 -0
- package/Runtime/Core/Helper/Logging.meta +3 -0
- package/Runtime/Core/Helper/Objects.cs +1 -1
- package/Runtime/Core/Helper/Partials/LogHelpers.cs +2 -2
- package/Runtime/Core/Helper/Partials/MathHelpers.cs +1 -1
- package/Runtime/Core/Helper/Partials/ObjectHelpers.cs +5 -11
- package/Runtime/Core/Helper/Partials/TransformHelpers.cs +1 -1
- package/Runtime/Core/Helper/ReflectionHelpers.cs +173 -36
- package/Runtime/Core/Helper/SceneHelper.cs +3 -5
- package/Runtime/Core/Helper/SpriteHelpers.cs +3 -3
- package/Runtime/Core/Helper/StringInList.cs +1 -1
- package/Runtime/Core/Helper/UnityMainThreadDispatcher.cs +2 -4
- package/Runtime/Core/Helper/WallMath.cs +1 -1
- package/Runtime/Core/Math/Line.cs +1 -1
- package/Runtime/Core/Math/Parabola.cs +1 -1
- package/Runtime/Core/Math/PointPolygonCheck.cs +1 -1
- package/Runtime/Core/Math/Range.cs +1 -1
- package/Runtime/Core/Math/XXHash.cs +1 -1
- package/Runtime/Core/Model/Direction.cs +1 -1
- package/Runtime/Core/OneOf/FastOneOf.cs +1 -1
- package/Runtime/Core/OneOf/None.cs +1 -1
- package/Runtime/Core/Random/AbstractRandom.cs +1 -1
- package/Runtime/Core/Random/DotNetRandom.cs +1 -1
- package/Runtime/Core/Random/IRandom.cs +1 -1
- package/Runtime/Core/Random/LinearCongruentialGenerator.cs +1 -1
- package/Runtime/Core/Random/NativePcgRandom.cs +1 -1
- package/Runtime/Core/Random/PRNG.cs +1 -1
- package/Runtime/Core/Random/PcgRandom.cs +1 -1
- package/Runtime/Core/Random/PerlinNoise.cs +1 -1
- package/Runtime/Core/Random/RandomState.cs +1 -1
- package/Runtime/Core/Random/RandomUtilities.cs +1 -1
- package/Runtime/Core/Random/RomuDuo.cs +1 -1
- package/Runtime/Core/Random/SplitMix64.cs +1 -1
- package/Runtime/Core/Random/SquirrelRandom.cs +1 -1
- package/Runtime/Core/Random/SystemRandom.cs +1 -1
- package/Runtime/Core/Random/ThreadLocalRandom.cs +1 -1
- package/Runtime/Core/Random/UnityRandom.cs +1 -1
- package/Runtime/Core/Random/WyRandom.cs +1 -1
- package/Runtime/Core/Random/XorShiftRandom.cs +1 -1
- package/Runtime/Core/Random/XorShiroRandom.cs +1 -1
- package/Runtime/Core/Serialization/JsonConverters/ColorConverter.cs +1 -1
- package/Runtime/Core/Serialization/JsonConverters/GameObjectConverter.cs +1 -2
- package/Runtime/Core/Serialization/JsonConverters/Matrix4x4Converter.cs +1 -1
- package/Runtime/Core/Serialization/JsonConverters/TypeConverter.cs +1 -1
- package/Runtime/Core/Serialization/JsonConverters/Vector2Converter.cs +1 -1
- package/Runtime/Core/Serialization/JsonConverters/Vector3Converter.cs +1 -1
- package/Runtime/Core/Serialization/JsonConverters/Vector4Converter.cs +1 -1
- package/Runtime/Core/Serialization/Serializer.cs +1 -1
- package/Runtime/Core/Threading/SingleThreadedThreadPool.cs +1 -1
- package/Runtime/UI/LayeredImage.cs +1 -1
- package/Runtime/Utils/AnimationEventEqualityComparer.cs +1 -1
- package/Runtime/Utils/AnimatorEnumStateMachine.cs +1 -1
- package/Runtime/Utils/Buffers.cs +1 -1
- package/Runtime/Utils/CenterPointOffset.cs +1 -1
- package/Runtime/Utils/CircleLineRenderer.cs +4 -6
- package/Runtime/Utils/CoroutineHandler.cs +1 -1
- package/Runtime/Utils/DeferredDisposalResult.cs +1 -1
- package/Runtime/Utils/MatchColliderToSprite.cs +1 -1
- package/Runtime/Utils/Oscillator.cs +1 -1
- package/Runtime/Utils/RuntimeSingleton.cs +1 -1
- package/Runtime/Utils/SetTextureImportData.cs +1 -1
- package/Runtime/Utils/SpriteRendererMetadata.cs +1 -1
- package/Runtime/Utils/SpriteRendererSyncer.cs +1 -1
- package/Runtime/Utils/StartTracker.cs +1 -1
- package/Runtime/Utils/TextureScale.cs +1 -1
- package/Runtime/Utils/TypeNameSorter.cs +17 -0
- package/Runtime/Utils/TypeNameSorter.cs.meta +3 -0
- package/Runtime/Utils/UnityObjectNameComparer.cs +1 -1
- package/Runtime/WallstopStudios.UnityHelpers.asmdef +1 -1
- package/Tests/Runtime/Attributes/ChildComponentTests.cs +2 -2
- package/Tests/Runtime/Attributes/Components/ExpectChildSpriteRenderers.cs +2 -2
- package/Tests/Runtime/Attributes/Components/ExpectParentSpriteRenderers.cs +2 -2
- package/Tests/Runtime/Attributes/ParentComponentTests.cs +2 -2
- package/Tests/Runtime/Components/RelationalComponentTesterComplex.cs +2 -2
- package/Tests/Runtime/Components/RelationalComponentsTesterSimple.cs +4 -4
- package/Tests/Runtime/DataStructures/BalancedKDTreeTests.cs +2 -2
- package/Tests/Runtime/DataStructures/CyclicBufferTests.cs +3 -3
- package/Tests/Runtime/DataStructures/QuadTreeTests.cs +2 -2
- package/Tests/Runtime/DataStructures/SpatialTreeTests.cs +4 -4
- package/Tests/Runtime/DataStructures/UnbalancedKDTreeTests.cs +2 -2
- package/Tests/Runtime/Extensions/DictionaryExtensionTests.cs +2 -3
- package/Tests/Runtime/Extensions/EnumExtensionTests.cs +2 -2
- package/Tests/Runtime/Extensions/IListExtensionTests.cs +3 -3
- package/Tests/Runtime/Extensions/LoggingExtensionTests.cs +718 -0
- package/Tests/Runtime/Extensions/LoggingExtensionTests.cs.meta +3 -0
- package/Tests/Runtime/Extensions/RandomExtensionTests.cs +3 -3
- package/Tests/Runtime/Extensions/StringExtensionTests.cs +2 -2
- package/Tests/Runtime/Helper/ArrayConverterTests.cs +3 -3
- package/Tests/Runtime/Helper/FormattingHelperTests.cs +3 -3
- package/Tests/Runtime/Helper/ObjectHelperTests.cs +2 -2
- package/Tests/Runtime/Helper/ReflectionHelperTests.cs +3 -3
- package/Tests/Runtime/Helper/SceneHelperTests.cs +3 -3
- package/Tests/Runtime/Helper/WallMathTests.cs +5 -5
- package/Tests/Runtime/Performance/KDTreePerformanceTests.cs +2 -2
- package/Tests/Runtime/Performance/QuadTreePerformanceTests.cs +2 -2
- package/Tests/Runtime/Performance/RandomPerformanceTests.cs +2 -2
- package/Tests/Runtime/Performance/RelationComponentPerformanceTests.cs +2 -2
- package/Tests/Runtime/Performance/SpatialTreePerformanceTest.cs +2 -2
- package/Tests/Runtime/Performance/UnbalancedKDTreeTests.cs +2 -2
- package/Tests/Runtime/Random/DotNetRandomTests.cs +2 -2
- package/Tests/Runtime/Random/LinearCongruentialGeneratorTests.cs +2 -2
- package/Tests/Runtime/Random/PcgRandomTests.cs +2 -2
- package/Tests/Runtime/Random/RandomTestBase.cs +7 -7
- package/Tests/Runtime/Random/RomuDuoRandomTests.cs +2 -2
- package/Tests/Runtime/Random/SplitMix64RandomTests.cs +2 -2
- package/Tests/Runtime/Random/SquirrelRandomTests.cs +2 -2
- package/Tests/Runtime/Random/SystemRandomTests.cs +2 -2
- package/Tests/Runtime/Random/UnityRandomTests.cs +2 -2
- package/Tests/Runtime/Random/WyRandomTests.cs +2 -2
- package/Tests/Runtime/Random/XorShiftRandomTests.cs +2 -2
- package/Tests/Runtime/Random/XorShiroRandomTests.cs +2 -2
- package/Tests/Runtime/Serialization/JsonSerializationTest.cs +5 -5
- package/Tests/Runtime/Utils/SpriteRendererMetadataTests.cs +3 -4
- package/Tests/Runtime/WallstopStudios.UnityHelpers.Tests.Runtime.asmdef +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
namespace UnityHelpers.Editor
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Editor
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
4
|
using System;
|
|
5
5
|
using System.IO;
|
|
6
|
-
using Core.Attributes;
|
|
7
|
-
using Core.Extension;
|
|
8
6
|
using UnityEditor;
|
|
9
7
|
using UnityEngine;
|
|
10
8
|
using Utils;
|
|
9
|
+
using WallstopStudios.UnityHelpers.Core.Attributes;
|
|
10
|
+
using WallstopStudios.UnityHelpers.Core.Extension;
|
|
11
11
|
|
|
12
12
|
public sealed class AnimationCopier : ScriptableWizard
|
|
13
13
|
{
|
|
@@ -121,8 +121,7 @@
|
|
|
121
121
|
if (animationClip == null)
|
|
122
122
|
{
|
|
123
123
|
this.LogError(
|
|
124
|
-
"Invalid AnimationClip (null) found at path '{
|
|
125
|
-
path
|
|
124
|
+
$"Invalid AnimationClip (null) found at path '{path}', skipping."
|
|
126
125
|
);
|
|
127
126
|
continue;
|
|
128
127
|
}
|
|
@@ -136,9 +135,7 @@
|
|
|
136
135
|
if (prefixIndex < 0)
|
|
137
136
|
{
|
|
138
137
|
this.LogWarn(
|
|
139
|
-
"Unsupported animation at '{
|
|
140
|
-
path,
|
|
141
|
-
prefix
|
|
138
|
+
$"Unsupported animation at '{path}', expected to be prefixed by '{prefix}'."
|
|
142
139
|
);
|
|
143
140
|
continue;
|
|
144
141
|
}
|
|
@@ -159,18 +156,14 @@
|
|
|
159
156
|
bool deleteSuccessful = AssetDatabase.DeleteAsset(path);
|
|
160
157
|
if (!deleteSuccessful)
|
|
161
158
|
{
|
|
162
|
-
this.LogError("Failed to delete asset at path '{
|
|
159
|
+
this.LogError($"Failed to delete asset at path '{path}'.");
|
|
163
160
|
}
|
|
164
161
|
|
|
165
162
|
++processed;
|
|
166
163
|
}
|
|
167
164
|
else
|
|
168
165
|
{
|
|
169
|
-
this.LogError(
|
|
170
|
-
"Failed to copy animation from '{0}' to '{1}'.",
|
|
171
|
-
path,
|
|
172
|
-
destination
|
|
173
|
-
);
|
|
166
|
+
this.LogError($"Failed to copy animation from '{path}' to '{destination}'.");
|
|
174
167
|
}
|
|
175
168
|
}
|
|
176
169
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
namespace UnityHelpers.Editor
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Editor
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
4
|
using System;
|
|
5
5
|
using System.Collections.Generic;
|
|
6
6
|
using System.Linq;
|
|
7
|
-
using Core.Extension;
|
|
8
7
|
using UnityEditor;
|
|
9
8
|
using UnityEngine;
|
|
9
|
+
using WallstopStudios.UnityHelpers.Core.Extension;
|
|
10
10
|
using Object = UnityEngine.Object;
|
|
11
11
|
|
|
12
12
|
[Serializable]
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
}
|
|
114
114
|
else
|
|
115
115
|
{
|
|
116
|
-
this.LogWarn("Failed to process frame {
|
|
116
|
+
this.LogWarn($"Failed to process frame {frameName}.");
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
string animationName = data.animationName;
|
|
180
180
|
if (string.IsNullOrWhiteSpace(animationName))
|
|
181
181
|
{
|
|
182
|
-
this.LogWarn("Ignoring animationData without an animation name.");
|
|
182
|
+
this.LogWarn($"Ignoring animationData without an animation name.");
|
|
183
183
|
continue;
|
|
184
184
|
}
|
|
185
185
|
|
|
@@ -187,9 +187,7 @@
|
|
|
187
187
|
if (framesPerSecond <= 0)
|
|
188
188
|
{
|
|
189
189
|
this.LogWarn(
|
|
190
|
-
"Ignoring animationData with FPS of {
|
|
191
|
-
framesPerSecond,
|
|
192
|
-
animationName
|
|
190
|
+
$"Ignoring animationData with FPS of {framesPerSecond} with name {animationName}."
|
|
193
191
|
);
|
|
194
192
|
continue;
|
|
195
193
|
}
|
|
@@ -198,8 +196,7 @@
|
|
|
198
196
|
if (frames is not { Count: > 0 })
|
|
199
197
|
{
|
|
200
198
|
this.LogWarn(
|
|
201
|
-
"Ignoring animationData without frames with name {
|
|
202
|
-
animationName
|
|
199
|
+
$"Ignoring animationData without frames with name {animationName}."
|
|
203
200
|
);
|
|
204
201
|
continue;
|
|
205
202
|
}
|
|
@@ -227,8 +224,7 @@
|
|
|
227
224
|
if (keyFrames.Count <= 0)
|
|
228
225
|
{
|
|
229
226
|
this.LogWarn(
|
|
230
|
-
"Ignoring animationData with empty frames with name {
|
|
231
|
-
animationName
|
|
227
|
+
$"Ignoring animationData with empty frames with name {animationName}."
|
|
232
228
|
);
|
|
233
229
|
continue;
|
|
234
230
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
namespace UnityHelpers.Editor
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Editor
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
4
|
using System;
|
|
5
|
-
using System.Linq;
|
|
6
5
|
using System.Collections.Generic;
|
|
6
|
+
using System.Linq;
|
|
7
7
|
using System.Reflection;
|
|
8
|
-
using Core.Attributes;
|
|
9
|
-
using Core.Helper;
|
|
10
|
-
using UnityEngine;
|
|
11
8
|
using UnityEditor;
|
|
12
|
-
using
|
|
9
|
+
using UnityEngine;
|
|
10
|
+
using WallstopStudios.UnityHelpers.Core.Attributes;
|
|
11
|
+
using WallstopStudios.UnityHelpers.Core.Helper;
|
|
12
|
+
using WallstopStudios.UnityHelpers.Utils;
|
|
13
13
|
|
|
14
14
|
// https://gist.githubusercontent.com/yujen/5e1cd78e2a341260b38029de08a449da/raw/ac60c1002e0e14375de5b2b0a167af00df3f74b4/SeniaAnimationEventEditor.cs
|
|
15
15
|
public sealed class AnimationEventEditor : EditorWindow
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
namespace UnityHelpers.Editor
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Editor
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
4
|
using System;
|
|
5
5
|
using System.IO;
|
|
6
|
-
using Core.Attributes;
|
|
7
|
-
using Core.Extension;
|
|
8
6
|
using UnityEditor;
|
|
9
7
|
using UnityEngine;
|
|
10
8
|
using Utils;
|
|
9
|
+
using WallstopStudios.UnityHelpers.Core.Attributes;
|
|
10
|
+
using WallstopStudios.UnityHelpers.Core.Extension;
|
|
11
11
|
|
|
12
12
|
public sealed class AnimatorControllerCopier : ScriptableWizard
|
|
13
13
|
{
|
|
@@ -99,8 +99,7 @@
|
|
|
99
99
|
if (animatorController == null)
|
|
100
100
|
{
|
|
101
101
|
this.LogError(
|
|
102
|
-
"Invalid Animator Controller (null) found at path '{
|
|
103
|
-
path
|
|
102
|
+
$"Invalid Animator Controller (null) found at path '{path}', skipping."
|
|
104
103
|
);
|
|
105
104
|
continue;
|
|
106
105
|
}
|
|
@@ -114,9 +113,7 @@
|
|
|
114
113
|
if (prefixIndex < 0)
|
|
115
114
|
{
|
|
116
115
|
this.LogWarn(
|
|
117
|
-
"Unsupported AnimatorController at '{
|
|
118
|
-
path,
|
|
119
|
-
prefix
|
|
116
|
+
$"Unsupported AnimatorController at '{path}', expected to be prefixed by '{prefix}'."
|
|
120
117
|
);
|
|
121
118
|
continue;
|
|
122
119
|
}
|
|
@@ -138,8 +135,7 @@
|
|
|
138
135
|
if (!deleteSuccessful)
|
|
139
136
|
{
|
|
140
137
|
this.LogError(
|
|
141
|
-
"Failed to delete Animator Controller asset at path '{
|
|
142
|
-
path
|
|
138
|
+
$"Failed to delete Animator Controller asset at path '{path}'."
|
|
143
139
|
);
|
|
144
140
|
}
|
|
145
141
|
|
|
@@ -148,9 +144,7 @@
|
|
|
148
144
|
else
|
|
149
145
|
{
|
|
150
146
|
this.LogError(
|
|
151
|
-
"Failed to copy Animator Controller from '{
|
|
152
|
-
path,
|
|
153
|
-
destination
|
|
147
|
+
$"Failed to copy Animator Controller from '{path}' to '{destination}'."
|
|
154
148
|
);
|
|
155
149
|
}
|
|
156
150
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
namespace UnityHelpers.Editor.CustomEditors
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Editor.CustomEditors
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
|
-
using Core.Extension;
|
|
5
4
|
using UnityEditor;
|
|
6
5
|
using UnityEngine;
|
|
7
|
-
using UnityHelpers.
|
|
6
|
+
using WallstopStudios.UnityHelpers.Core.Extension;
|
|
7
|
+
using WallstopStudios.UnityHelpers.Utils;
|
|
8
8
|
|
|
9
9
|
[CustomEditor(typeof(MatchColliderToSprite))]
|
|
10
10
|
public sealed class MatchColliderToSpriteEditor : Editor
|
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
if (matchColliderToSprite == null)
|
|
18
18
|
{
|
|
19
19
|
this.LogError(
|
|
20
|
-
"Target was of type {
|
|
21
|
-
target?.GetType(),
|
|
22
|
-
typeof(MatchColliderToSprite)
|
|
20
|
+
$"Target was of type {target?.GetType()}, expected {nameof(MatchColliderToSprite)}."
|
|
23
21
|
);
|
|
24
22
|
return;
|
|
25
23
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
namespace UnityHelpers.Editor
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Editor
|
|
2
2
|
{
|
|
3
3
|
using System.Collections.Generic;
|
|
4
4
|
using System.Linq;
|
|
5
|
-
using Core.Extension;
|
|
6
5
|
using UnityEditor;
|
|
7
6
|
using UnityEngine;
|
|
7
|
+
using WallstopStudios.UnityHelpers.Core.Extension;
|
|
8
8
|
|
|
9
9
|
public enum FitMode
|
|
10
10
|
{
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
textures = textures.Distinct().OrderBy(texture => texture.name).ToList();
|
|
72
72
|
if (textures.Count <= 0)
|
|
73
73
|
{
|
|
74
|
-
this.Log("Failed to find any texture paths.");
|
|
74
|
+
this.Log($"Failed to find any texture paths.");
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
}
|
|
141
141
|
else
|
|
142
142
|
{
|
|
143
|
-
this.Log("No textures updated.");
|
|
143
|
+
this.Log($"No textures updated.");
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
namespace UnityHelpers.Editor
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Editor
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
4
|
using System;
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
using System.Collections.Generic;
|
|
7
7
|
using System.Linq;
|
|
8
8
|
using System.Reflection;
|
|
9
|
-
using Core.Attributes;
|
|
10
9
|
using UnityEditor;
|
|
11
10
|
using UnityEngine;
|
|
11
|
+
using Core.Attributes;
|
|
12
12
|
using Core.Extension;
|
|
13
13
|
using Core.Helper;
|
|
14
|
-
using UnityHelpers.Utils;
|
|
14
|
+
using WallstopStudios.UnityHelpers.Utils;
|
|
15
15
|
using Object = UnityEngine.Object;
|
|
16
16
|
|
|
17
17
|
public sealed class PrefabCheckWizard : ScriptableWizard
|
|
@@ -60,13 +60,12 @@
|
|
|
60
60
|
Type scriptType = script?.GetType();
|
|
61
61
|
if (scriptType == null)
|
|
62
62
|
{
|
|
63
|
-
prefab.LogError("Detected missing script.");
|
|
63
|
+
prefab.LogError($"Detected missing script.");
|
|
64
64
|
}
|
|
65
65
|
else
|
|
66
66
|
{
|
|
67
67
|
prefab.LogError(
|
|
68
|
-
"Detected missing script for script type {
|
|
69
|
-
scriptType
|
|
68
|
+
$"Detected missing script for script type {scriptType}."
|
|
70
69
|
);
|
|
71
70
|
}
|
|
72
71
|
|
|
@@ -111,7 +110,7 @@
|
|
|
111
110
|
{
|
|
112
111
|
if (fieldValue == null)
|
|
113
112
|
{
|
|
114
|
-
component.LogError("Field {
|
|
113
|
+
component.LogError($"Field {field.Name} (array) was null.");
|
|
115
114
|
continue;
|
|
116
115
|
}
|
|
117
116
|
|
|
@@ -141,20 +140,18 @@
|
|
|
141
140
|
|
|
142
141
|
continue;
|
|
143
142
|
|
|
144
|
-
bool LogIfNull(object thing, int?
|
|
143
|
+
bool LogIfNull(object thing, int? elementIndex = null)
|
|
145
144
|
{
|
|
146
145
|
if (thing == null || (thing is Object unityThing && !unityThing))
|
|
147
146
|
{
|
|
148
|
-
if (
|
|
147
|
+
if (elementIndex == null)
|
|
149
148
|
{
|
|
150
|
-
component.LogError("Field {
|
|
149
|
+
component.LogError($"Field {field.Name} has a null element in it.");
|
|
151
150
|
}
|
|
152
151
|
else
|
|
153
152
|
{
|
|
154
153
|
component.LogError(
|
|
155
|
-
"Field {
|
|
156
|
-
field.Name,
|
|
157
|
-
position
|
|
154
|
+
$"Field {field.Name} has a null element at position {elementIndex}."
|
|
158
155
|
);
|
|
159
156
|
}
|
|
160
157
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
namespace UnityHelpers.Editor
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Editor
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
4
|
using System;
|
|
5
5
|
using System.Collections.Generic;
|
|
6
6
|
using System.IO;
|
|
7
7
|
using System.Linq;
|
|
8
|
+
using UnityEditor;
|
|
9
|
+
using UnityEngine;
|
|
8
10
|
using Core.Attributes;
|
|
9
11
|
using Core.Extension;
|
|
10
12
|
using Core.Helper;
|
|
11
|
-
using UnityEditor;
|
|
12
|
-
using UnityEngine;
|
|
13
13
|
using Object = UnityEngine.Object;
|
|
14
14
|
|
|
15
15
|
[Serializable]
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
this.Log("Processed {
|
|
175
|
+
this.Log($"Processed {spriteCount} sprites.");
|
|
176
176
|
if (0 < spriteCount)
|
|
177
177
|
{
|
|
178
178
|
AssetDatabase.Refresh();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
namespace UnityHelpers.Editor
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Editor
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
4
|
using System;
|
|
5
5
|
using UnityEditor;
|
|
6
6
|
using UnityEngine;
|
|
7
|
-
using
|
|
7
|
+
using Core.Helper;
|
|
8
8
|
|
|
9
9
|
[CustomPropertyDrawer(typeof(StringInList))]
|
|
10
10
|
public class StringInListDrawer : PropertyDrawer
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
namespace UnityHelpers.Editor
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Editor
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
4
|
using System;
|
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
using System.ComponentModel;
|
|
7
7
|
using System.IO;
|
|
8
8
|
using System.Linq;
|
|
9
|
-
using Core.Extension;
|
|
10
|
-
using Core.Helper;
|
|
11
9
|
using UnityEditor;
|
|
12
10
|
using UnityEngine;
|
|
13
11
|
using UnityEngine.Serialization;
|
|
14
|
-
using UnityHelpers.
|
|
15
|
-
using
|
|
12
|
+
using WallstopStudios.UnityHelpers.Core.Extension;
|
|
13
|
+
using WallstopStudios.UnityHelpers.Core.Helper;
|
|
14
|
+
using WallstopStudios.UnityHelpers.Utils;
|
|
16
15
|
using Object = UnityEngine.Object;
|
|
17
16
|
|
|
18
17
|
public sealed class TextureResizerWizard : ScriptableWizard
|
|
@@ -155,17 +154,12 @@
|
|
|
155
154
|
byte[] bytes = copy.EncodeToPNG();
|
|
156
155
|
File.WriteAllBytes(assetPath, bytes);
|
|
157
156
|
this.Log(
|
|
158
|
-
"Resized {
|
|
159
|
-
texture.name,
|
|
160
|
-
texture.width,
|
|
161
|
-
texture.height,
|
|
162
|
-
copy.width,
|
|
163
|
-
copy.height
|
|
157
|
+
$"Resized {texture.name} from [{texture.width}x{texture.height}] to [{copy.width}x{copy.height}]"
|
|
164
158
|
);
|
|
165
159
|
}
|
|
166
160
|
catch (Exception e)
|
|
167
161
|
{
|
|
168
|
-
this.LogError("Failed to resize {
|
|
162
|
+
this.LogError($"Failed to resize {texture.name}.", e);
|
|
169
163
|
}
|
|
170
164
|
finally
|
|
171
165
|
{
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
namespace UnityHelpers.Editor
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Editor
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
4
|
using System;
|
|
5
5
|
using System.Collections.Generic;
|
|
6
6
|
using System.IO;
|
|
7
7
|
using System.Linq;
|
|
8
|
-
using Core.Attributes;
|
|
9
|
-
using Core.Extension;
|
|
10
8
|
using UnityEditor;
|
|
11
9
|
using UnityEngine;
|
|
12
|
-
using UnityHelpers.
|
|
10
|
+
using WallstopStudios.UnityHelpers.Core.Attributes;
|
|
11
|
+
using WallstopStudios.UnityHelpers.Core.Extension;
|
|
12
|
+
using WallstopStudios.UnityHelpers.Utils;
|
|
13
13
|
using Object = UnityEngine.Object;
|
|
14
14
|
|
|
15
15
|
public sealed class TextureSettingsApplier : ScriptableWizard
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
this.Log("Processed {
|
|
128
|
+
this.Log($"Processed {textureCount} textures.");
|
|
129
129
|
if (0 < textureCount)
|
|
130
130
|
{
|
|
131
131
|
AssetDatabase.Refresh();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
namespace UnityHelpers.Editor.Utils
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Editor.Utils
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
|
-
using Core.Attributes;
|
|
5
4
|
using UnityEditor;
|
|
6
5
|
using UnityEngine;
|
|
6
|
+
using WallstopStudios.UnityHelpers.Core.Attributes;
|
|
7
7
|
|
|
8
8
|
// https://www.patrykgalach.com/2020/01/20/readonly-attribute-in-unity-editor/
|
|
9
9
|
[CustomPropertyDrawer(typeof(DxReadOnlyAttribute))]
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
namespace UnityHelpers.Editor
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Editor
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
4
|
using System.Reflection;
|
|
5
|
-
using Core.Attributes;
|
|
6
|
-
using Core.Extension;
|
|
7
|
-
using UnityEngine;
|
|
8
5
|
using UnityEditor;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
using WallstopStudios.UnityHelpers.Core.Attributes;
|
|
8
|
+
using WallstopStudios.UnityHelpers.Core.Extension;
|
|
9
9
|
|
|
10
10
|
[CustomPropertyDrawer(typeof(WShowIfAttribute))]
|
|
11
11
|
public sealed class WShowIfPropertyDrawer : PropertyDrawer
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
namespace UnityHelpers.Core.Attributes
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Core.Attributes
|
|
2
2
|
{
|
|
3
3
|
using System;
|
|
4
4
|
using System.Collections;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
using System.Reflection;
|
|
8
8
|
using Extension;
|
|
9
9
|
using Helper;
|
|
10
|
+
using Helper.Partials;
|
|
10
11
|
using JetBrains.Annotations;
|
|
11
12
|
using UnityEngine;
|
|
12
13
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
namespace UnityHelpers.Core.Attributes
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Core.Attributes
|
|
2
2
|
{
|
|
3
3
|
using System;
|
|
4
4
|
using System.Collections;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
using System.Linq;
|
|
7
7
|
using System.Reflection;
|
|
8
8
|
using Extension;
|
|
9
|
-
using Helper;
|
|
9
|
+
using Helper.Partials;
|
|
10
10
|
using JetBrains.Annotations;
|
|
11
11
|
using Object = UnityEngine.Object;
|
|
12
12
|
|
|
@@ -23,11 +23,16 @@
|
|
|
23
23
|
return FieldsByType.GetOrAdd(
|
|
24
24
|
objectType,
|
|
25
25
|
type =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
Enumerable
|
|
27
|
+
.Where<FieldInfo>(
|
|
28
|
+
type.GetFields(
|
|
29
|
+
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic
|
|
30
|
+
),
|
|
31
|
+
prop =>
|
|
32
|
+
Attribute.IsDefined(
|
|
33
|
+
(MemberInfo)prop,
|
|
34
|
+
typeof(ValidateAssignmentAttribute)
|
|
35
|
+
)
|
|
31
36
|
)
|
|
32
37
|
.ToArray()
|
|
33
38
|
);
|