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.
Files changed (177) hide show
  1. package/Editor/AnimationCopier.cs +7 -14
  2. package/Editor/AnimationCreator.cs +7 -11
  3. package/Editor/AnimationEventEditor.cs +6 -6
  4. package/Editor/AnimatorControllerCopier.cs +7 -13
  5. package/Editor/CustomEditors/MatchColliderToSpriteEditor.cs +4 -6
  6. package/Editor/FitTextureSizeWizard.cs +4 -4
  7. package/Editor/PrefabCheckWizard.cs +10 -13
  8. package/Editor/SpriteSettingsApplier.cs +4 -4
  9. package/Editor/StringInListeDrawer.cs +2 -2
  10. package/Editor/TextureResizerWizard.cs +6 -12
  11. package/Editor/TextureSettingsApplier.cs +5 -5
  12. package/Editor/Utils/DxReadOnlyPropertyDrawer.cs +2 -2
  13. package/Editor/Utils/EditorUtilities.cs +1 -1
  14. package/Editor/WShowIfPropertyDrawer.cs +4 -4
  15. package/Editor/WallstopStudios.UnityHelpers.Editor.asmdef +1 -1
  16. package/Runtime/Core/Attributes/AnimationEventAttribute.cs +1 -1
  17. package/Runtime/Core/Attributes/ChildComponentAttribute.cs +2 -1
  18. package/Runtime/Core/Attributes/DxReadOnlyAttribute.cs +1 -1
  19. package/Runtime/Core/Attributes/KSerializableAttribute.cs +1 -1
  20. package/Runtime/Core/Attributes/NotNullAttribute.cs +1 -1
  21. package/Runtime/Core/Attributes/ParentComponent.cs +1 -1
  22. package/Runtime/Core/Attributes/RelationalComponentExtensions.cs +1 -1
  23. package/Runtime/Core/Attributes/SiblingComponentAttribute.cs +1 -1
  24. package/Runtime/Core/Attributes/ValidateAssignmentAttribute.cs +12 -7
  25. package/Runtime/Core/Attributes/WShowIfAttribute.cs +1 -1
  26. package/Runtime/Core/DataStructure/Adapters/FastVector2Int.cs +1 -1
  27. package/Runtime/Core/DataStructure/Adapters/FastVector3Int.cs +1 -1
  28. package/Runtime/Core/DataStructure/Adapters/KGuid.cs +1 -1
  29. package/Runtime/Core/DataStructure/Adapters/KVector2.cs +1 -1
  30. package/Runtime/Core/DataStructure/Circle.cs +1 -1
  31. package/Runtime/Core/DataStructure/CyclicBuffer.cs +1 -1
  32. package/Runtime/Core/DataStructure/ISpatialTree.cs +1 -1
  33. package/Runtime/Core/DataStructure/KDTree.cs +1 -1
  34. package/Runtime/Core/DataStructure/QuadTree.cs +1 -1
  35. package/Runtime/Core/DataStructure/RTree.cs +1 -1
  36. package/Runtime/Core/DataStructure/StringWrapper.cs +1 -1
  37. package/Runtime/Core/DataStructure/TimedCache.cs +1 -1
  38. package/Runtime/Core/Extension/AnimatorExtensions.cs +1 -1
  39. package/Runtime/Core/Extension/AsyncOperationExtensions.cs +1 -1
  40. package/Runtime/Core/Extension/CircleExtensions.cs +1 -1
  41. package/Runtime/Core/Extension/ColorExtensions.cs +16 -1
  42. package/Runtime/Core/Extension/DictionaryExtensions.cs +1 -1
  43. package/Runtime/Core/Extension/DirectionExtensions.cs +1 -1
  44. package/Runtime/Core/Extension/EnumExtensions.cs +1 -1
  45. package/Runtime/Core/Extension/HashSetExtensions.cs +1 -1
  46. package/Runtime/Core/Extension/IEnumerableExtensions.cs +1 -1
  47. package/Runtime/Core/Extension/IListExtensions.cs +1 -1
  48. package/Runtime/Core/Extension/LoggingExtensions.cs +69 -122
  49. package/Runtime/Core/Extension/RandomExtensions.cs +1 -1
  50. package/Runtime/Core/Extension/SerializedPropertyExtensions.cs +2 -2
  51. package/Runtime/Core/Extension/StringExtensions.cs +1 -1
  52. package/Runtime/Core/Extension/UnityExtensions.cs +1 -2
  53. package/Runtime/Core/Helper/ArrayConverter.cs +1 -1
  54. package/Runtime/Core/Helper/AssignUtilities.cs +1 -1
  55. package/Runtime/Core/Helper/DirectoryHelper.cs +1 -1
  56. package/Runtime/Core/Helper/Enumerables.cs +1 -1
  57. package/Runtime/Core/Helper/FormattingHelpers.cs +1 -1
  58. package/Runtime/Core/Helper/Geometry.cs +1 -1
  59. package/Runtime/Core/Helper/Helpers.cs +6 -9
  60. package/Runtime/Core/Helper/IterationHelpers.cs +1 -1
  61. package/Runtime/Core/Helper/LifetimeHelpers.cs +2 -1
  62. package/Runtime/Core/Helper/Logging/UnityLogTagFormatter.cs +517 -0
  63. package/Runtime/Core/Helper/Logging/UnityLogTagFormatter.cs.meta +3 -0
  64. package/Runtime/Core/Helper/Logging.meta +3 -0
  65. package/Runtime/Core/Helper/Objects.cs +1 -1
  66. package/Runtime/Core/Helper/Partials/LogHelpers.cs +2 -2
  67. package/Runtime/Core/Helper/Partials/MathHelpers.cs +1 -1
  68. package/Runtime/Core/Helper/Partials/ObjectHelpers.cs +5 -11
  69. package/Runtime/Core/Helper/Partials/TransformHelpers.cs +1 -1
  70. package/Runtime/Core/Helper/ReflectionHelpers.cs +173 -36
  71. package/Runtime/Core/Helper/SceneHelper.cs +3 -5
  72. package/Runtime/Core/Helper/SpriteHelpers.cs +3 -3
  73. package/Runtime/Core/Helper/StringInList.cs +1 -1
  74. package/Runtime/Core/Helper/UnityMainThreadDispatcher.cs +2 -4
  75. package/Runtime/Core/Helper/WallMath.cs +1 -1
  76. package/Runtime/Core/Math/Line.cs +1 -1
  77. package/Runtime/Core/Math/Parabola.cs +1 -1
  78. package/Runtime/Core/Math/PointPolygonCheck.cs +1 -1
  79. package/Runtime/Core/Math/Range.cs +1 -1
  80. package/Runtime/Core/Math/XXHash.cs +1 -1
  81. package/Runtime/Core/Model/Direction.cs +1 -1
  82. package/Runtime/Core/OneOf/FastOneOf.cs +1 -1
  83. package/Runtime/Core/OneOf/None.cs +1 -1
  84. package/Runtime/Core/Random/AbstractRandom.cs +1 -1
  85. package/Runtime/Core/Random/DotNetRandom.cs +1 -1
  86. package/Runtime/Core/Random/IRandom.cs +1 -1
  87. package/Runtime/Core/Random/LinearCongruentialGenerator.cs +1 -1
  88. package/Runtime/Core/Random/NativePcgRandom.cs +1 -1
  89. package/Runtime/Core/Random/PRNG.cs +1 -1
  90. package/Runtime/Core/Random/PcgRandom.cs +1 -1
  91. package/Runtime/Core/Random/PerlinNoise.cs +1 -1
  92. package/Runtime/Core/Random/RandomState.cs +1 -1
  93. package/Runtime/Core/Random/RandomUtilities.cs +1 -1
  94. package/Runtime/Core/Random/RomuDuo.cs +1 -1
  95. package/Runtime/Core/Random/SplitMix64.cs +1 -1
  96. package/Runtime/Core/Random/SquirrelRandom.cs +1 -1
  97. package/Runtime/Core/Random/SystemRandom.cs +1 -1
  98. package/Runtime/Core/Random/ThreadLocalRandom.cs +1 -1
  99. package/Runtime/Core/Random/UnityRandom.cs +1 -1
  100. package/Runtime/Core/Random/WyRandom.cs +1 -1
  101. package/Runtime/Core/Random/XorShiftRandom.cs +1 -1
  102. package/Runtime/Core/Random/XorShiroRandom.cs +1 -1
  103. package/Runtime/Core/Serialization/JsonConverters/ColorConverter.cs +1 -1
  104. package/Runtime/Core/Serialization/JsonConverters/GameObjectConverter.cs +1 -2
  105. package/Runtime/Core/Serialization/JsonConverters/Matrix4x4Converter.cs +1 -1
  106. package/Runtime/Core/Serialization/JsonConverters/TypeConverter.cs +1 -1
  107. package/Runtime/Core/Serialization/JsonConverters/Vector2Converter.cs +1 -1
  108. package/Runtime/Core/Serialization/JsonConverters/Vector3Converter.cs +1 -1
  109. package/Runtime/Core/Serialization/JsonConverters/Vector4Converter.cs +1 -1
  110. package/Runtime/Core/Serialization/Serializer.cs +1 -1
  111. package/Runtime/Core/Threading/SingleThreadedThreadPool.cs +1 -1
  112. package/Runtime/UI/LayeredImage.cs +1 -1
  113. package/Runtime/Utils/AnimationEventEqualityComparer.cs +1 -1
  114. package/Runtime/Utils/AnimatorEnumStateMachine.cs +1 -1
  115. package/Runtime/Utils/Buffers.cs +1 -1
  116. package/Runtime/Utils/CenterPointOffset.cs +1 -1
  117. package/Runtime/Utils/CircleLineRenderer.cs +4 -6
  118. package/Runtime/Utils/CoroutineHandler.cs +1 -1
  119. package/Runtime/Utils/DeferredDisposalResult.cs +1 -1
  120. package/Runtime/Utils/MatchColliderToSprite.cs +1 -1
  121. package/Runtime/Utils/Oscillator.cs +1 -1
  122. package/Runtime/Utils/RuntimeSingleton.cs +1 -1
  123. package/Runtime/Utils/SetTextureImportData.cs +1 -1
  124. package/Runtime/Utils/SpriteRendererMetadata.cs +1 -1
  125. package/Runtime/Utils/SpriteRendererSyncer.cs +1 -1
  126. package/Runtime/Utils/StartTracker.cs +1 -1
  127. package/Runtime/Utils/TextureScale.cs +1 -1
  128. package/Runtime/Utils/TypeNameSorter.cs +17 -0
  129. package/Runtime/Utils/TypeNameSorter.cs.meta +3 -0
  130. package/Runtime/Utils/UnityObjectNameComparer.cs +1 -1
  131. package/Runtime/WallstopStudios.UnityHelpers.asmdef +1 -1
  132. package/Tests/Runtime/Attributes/ChildComponentTests.cs +2 -2
  133. package/Tests/Runtime/Attributes/Components/ExpectChildSpriteRenderers.cs +2 -2
  134. package/Tests/Runtime/Attributes/Components/ExpectParentSpriteRenderers.cs +2 -2
  135. package/Tests/Runtime/Attributes/ParentComponentTests.cs +2 -2
  136. package/Tests/Runtime/Components/RelationalComponentTesterComplex.cs +2 -2
  137. package/Tests/Runtime/Components/RelationalComponentsTesterSimple.cs +4 -4
  138. package/Tests/Runtime/DataStructures/BalancedKDTreeTests.cs +2 -2
  139. package/Tests/Runtime/DataStructures/CyclicBufferTests.cs +3 -3
  140. package/Tests/Runtime/DataStructures/QuadTreeTests.cs +2 -2
  141. package/Tests/Runtime/DataStructures/SpatialTreeTests.cs +4 -4
  142. package/Tests/Runtime/DataStructures/UnbalancedKDTreeTests.cs +2 -2
  143. package/Tests/Runtime/Extensions/DictionaryExtensionTests.cs +2 -3
  144. package/Tests/Runtime/Extensions/EnumExtensionTests.cs +2 -2
  145. package/Tests/Runtime/Extensions/IListExtensionTests.cs +3 -3
  146. package/Tests/Runtime/Extensions/LoggingExtensionTests.cs +718 -0
  147. package/Tests/Runtime/Extensions/LoggingExtensionTests.cs.meta +3 -0
  148. package/Tests/Runtime/Extensions/RandomExtensionTests.cs +3 -3
  149. package/Tests/Runtime/Extensions/StringExtensionTests.cs +2 -2
  150. package/Tests/Runtime/Helper/ArrayConverterTests.cs +3 -3
  151. package/Tests/Runtime/Helper/FormattingHelperTests.cs +3 -3
  152. package/Tests/Runtime/Helper/ObjectHelperTests.cs +2 -2
  153. package/Tests/Runtime/Helper/ReflectionHelperTests.cs +3 -3
  154. package/Tests/Runtime/Helper/SceneHelperTests.cs +3 -3
  155. package/Tests/Runtime/Helper/WallMathTests.cs +5 -5
  156. package/Tests/Runtime/Performance/KDTreePerformanceTests.cs +2 -2
  157. package/Tests/Runtime/Performance/QuadTreePerformanceTests.cs +2 -2
  158. package/Tests/Runtime/Performance/RandomPerformanceTests.cs +2 -2
  159. package/Tests/Runtime/Performance/RelationComponentPerformanceTests.cs +2 -2
  160. package/Tests/Runtime/Performance/SpatialTreePerformanceTest.cs +2 -2
  161. package/Tests/Runtime/Performance/UnbalancedKDTreeTests.cs +2 -2
  162. package/Tests/Runtime/Random/DotNetRandomTests.cs +2 -2
  163. package/Tests/Runtime/Random/LinearCongruentialGeneratorTests.cs +2 -2
  164. package/Tests/Runtime/Random/PcgRandomTests.cs +2 -2
  165. package/Tests/Runtime/Random/RandomTestBase.cs +7 -7
  166. package/Tests/Runtime/Random/RomuDuoRandomTests.cs +2 -2
  167. package/Tests/Runtime/Random/SplitMix64RandomTests.cs +2 -2
  168. package/Tests/Runtime/Random/SquirrelRandomTests.cs +2 -2
  169. package/Tests/Runtime/Random/SystemRandomTests.cs +2 -2
  170. package/Tests/Runtime/Random/UnityRandomTests.cs +2 -2
  171. package/Tests/Runtime/Random/WyRandomTests.cs +2 -2
  172. package/Tests/Runtime/Random/XorShiftRandomTests.cs +2 -2
  173. package/Tests/Runtime/Random/XorShiroRandomTests.cs +2 -2
  174. package/Tests/Runtime/Serialization/JsonSerializationTest.cs +5 -5
  175. package/Tests/Runtime/Utils/SpriteRendererMetadataTests.cs +3 -4
  176. package/Tests/Runtime/WallstopStudios.UnityHelpers.Tests.Runtime.asmdef +1 -1
  177. 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 '{0}', skipping.",
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 '{0}', expected to be prefixed by '{1}'.",
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 '{0}'.", 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 {0}.", frameName);
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 {0} with name {1}.",
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 {0}.",
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 {0}.",
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 UnityHelpers.Utils;
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 '{0}', skipping.",
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 '{0}', expected to be prefixed by '{1}'.",
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 '{0}'.",
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 '{0}' to '{1}'.",
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.Utils;
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 {0}, expected {1}.",
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 {0}.",
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 {0} (array) was null.", field.Name);
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? position = null)
143
+ bool LogIfNull(object thing, int? elementIndex = null)
145
144
  {
146
145
  if (thing == null || (thing is Object unityThing && !unityThing))
147
146
  {
148
- if (position == null)
147
+ if (elementIndex == null)
149
148
  {
150
- component.LogError("Field {0} has a null element in it.", field.Name);
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 {0} has a null element at position {1}.",
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 {0} sprites.", spriteCount);
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 UnityHelpers.Core.Helper;
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.Utils;
15
- using Utils;
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 {0} from [{1}x{2}] to [{3}x{4}]",
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 {0}.", e, texture.name);
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.Utils;
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 {0} textures.", textureCount);
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,4 +1,4 @@
1
- namespace UnityHelpers.Editor.Utils
1
+ namespace WallstopStudios.UnityHelpers.Editor.Utils
2
2
  {
3
3
  #if UNITY_EDITOR
4
4
  using System;
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "WallstopStudios.UnityHelpers.Editor",
3
- "rootNamespace": "UnityHelpers",
3
+ "rootNamespace": "WallstopStudios.UnityHelpers.Editor",
4
4
  "references": [
5
5
  "WallstopStudios.UnityHelpers"
6
6
  ],
@@ -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.Generic;
@@ -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 PropertyAttribute = UnityEngine.PropertyAttribute;
4
4
 
@@ -1,4 +1,4 @@
1
- namespace UnityHelpers.Core.Attributes
1
+ namespace WallstopStudios.UnityHelpers.Core.Attributes
2
2
  {
3
3
  using System;
4
4
 
@@ -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.Generic;
@@ -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;
@@ -1,4 +1,4 @@
1
- namespace UnityHelpers.Core.Attributes
1
+ namespace WallstopStudios.UnityHelpers.Core.Attributes
2
2
  {
3
3
  using UnityEngine;
4
4
 
@@ -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;
@@ -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
- type.GetFields(
27
- BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic
28
- )
29
- .Where(prop =>
30
- Attribute.IsDefined(prop, typeof(ValidateAssignmentAttribute))
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
  );
@@ -1,4 +1,4 @@
1
- namespace UnityHelpers.Core.Attributes
1
+ namespace WallstopStudios.UnityHelpers.Core.Attributes
2
2
  {
3
3
  using UnityEngine;
4
4
 
@@ -1,4 +1,4 @@
1
- namespace UnityHelpers.Core.DataStructure.Adapters
1
+ namespace WallstopStudios.UnityHelpers.Core.DataStructure.Adapters
2
2
  {
3
3
  using System;
4
4
  using System.Runtime.CompilerServices;
@@ -1,4 +1,4 @@
1
- namespace UnityHelpers.Core.DataStructure.Adapters
1
+ namespace WallstopStudios.UnityHelpers.Core.DataStructure.Adapters
2
2
  {
3
3
  using System;
4
4
  using System.Runtime.CompilerServices;
@@ -1,4 +1,4 @@
1
- namespace UnityHelpers.Core.DataStructure.Adapters
1
+ namespace WallstopStudios.UnityHelpers.Core.DataStructure.Adapters
2
2
  {
3
3
  using System;
4
4
  using System.Runtime.Serialization;
@@ -1,4 +1,4 @@
1
- namespace UnityHelpers.Core.DataStructure.Adapters
1
+ namespace WallstopStudios.UnityHelpers.Core.DataStructure.Adapters
2
2
  {
3
3
  using System;
4
4
  using System.Runtime.Serialization;
@@ -1,4 +1,4 @@
1
- namespace UnityHelpers.Core.DataStructure
1
+ namespace WallstopStudios.UnityHelpers.Core.DataStructure
2
2
  {
3
3
  using System;
4
4
  using Extension;
@@ -1,4 +1,4 @@
1
- namespace UnityHelpers.Core.DataStructure
1
+ namespace WallstopStudios.UnityHelpers.Core.DataStructure
2
2
  {
3
3
  using System;
4
4
  using System.Collections;
@@ -1,4 +1,4 @@
1
- namespace UnityHelpers.Core.DataStructure
1
+ namespace WallstopStudios.UnityHelpers.Core.DataStructure
2
2
  {
3
3
  using System;
4
4
  using System.Collections.Generic;
@@ -1,4 +1,4 @@
1
- namespace UnityHelpers.Core.DataStructure
1
+ namespace WallstopStudios.UnityHelpers.Core.DataStructure
2
2
  {
3
3
  using System;
4
4
  using System.Collections.Generic;