com.wallstop-studios.unity-helpers 2.0.0-rc62 → 2.0.0-rc64
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 +3 -3
- package/Editor/AnimationCreator.cs +2 -2
- package/Editor/AnimationEventEditor.cs +6 -6
- package/Editor/AnimatorControllerCopier.cs +3 -3
- package/Editor/CustomEditors/MatchColliderToSpriteEditor.cs +3 -3
- package/Editor/FitTextureSizeWizard.cs +2 -2
- package/Editor/PrefabCheckWizard.cs +3 -3
- package/Editor/SpriteSettingsApplier.cs +3 -3
- package/Editor/StringInListeDrawer.cs +2 -2
- package/Editor/TextureResizerWizard.cs +4 -5
- package/Editor/TextureSettingsApplier.cs +4 -4
- 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 +1 -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 +1 -1
- 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 +3 -6
- package/Runtime/Core/Helper/IterationHelpers.cs +1 -1
- package/Runtime/Core/Helper/LifetimeHelpers.cs +2 -1
- package/Runtime/Core/Helper/Logging/UnityLogTagFormatter.cs +29 -1
- package/Runtime/Core/Helper/Objects.cs +1 -1
- package/Runtime/Core/Helper/Partials/LogHelpers.cs +1 -1
- package/Runtime/Core/Helper/Partials/MathHelpers.cs +1 -1
- package/Runtime/Core/Helper/Partials/ObjectHelpers.cs +1 -2
- package/Runtime/Core/Helper/Partials/TransformHelpers.cs +1 -1
- package/Runtime/Core/Helper/ReflectionHelpers.cs +24 -1
- package/Runtime/Core/Helper/SceneHelper.cs +1 -1
- package/Runtime/Core/Helper/SpriteHelpers.cs +1 -1
- 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 +1 -1
- 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 +4 -4
- 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 +4 -4
- 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 +5 -5
- 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,4 +1,4 @@
|
|
|
1
|
-
namespace UnityHelpers.Core.Helper.Logging
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Core.Helper.Logging
|
|
2
2
|
{
|
|
3
3
|
using System;
|
|
4
4
|
using System.Collections.Generic;
|
|
@@ -9,6 +9,21 @@
|
|
|
9
9
|
using Debug = UnityEngine.Debug;
|
|
10
10
|
using Object = UnityEngine.Object;
|
|
11
11
|
|
|
12
|
+
/// <summary>
|
|
13
|
+
/// Default supported formats:
|
|
14
|
+
/// b -> Bold text
|
|
15
|
+
/// bold -> Bold text
|
|
16
|
+
/// ! -> Bold text
|
|
17
|
+
/// i -> Italic text
|
|
18
|
+
/// italic -> Italic text
|
|
19
|
+
/// _ -> Italic text
|
|
20
|
+
/// json -> format as JSON
|
|
21
|
+
/// #color-hex -> Colored text
|
|
22
|
+
/// #color-name -> Colored text
|
|
23
|
+
/// color=value -> Colored text
|
|
24
|
+
/// 1-100 -> Sized text
|
|
25
|
+
/// size=1-100 -> Sized text
|
|
26
|
+
/// </summary>
|
|
12
27
|
public sealed class UnityLogTagFormatter : IFormatProvider, ICustomFormatter
|
|
13
28
|
{
|
|
14
29
|
public const char Separator = ',';
|
|
@@ -357,6 +372,7 @@
|
|
|
357
372
|
bool force = false
|
|
358
373
|
)
|
|
359
374
|
{
|
|
375
|
+
bool stopLooping = false;
|
|
360
376
|
foreach (var entry in _matchingDecorations)
|
|
361
377
|
{
|
|
362
378
|
for (int i = 0; i < entry.Value.Count; i++)
|
|
@@ -378,13 +394,25 @@
|
|
|
378
394
|
if (priority != entry.Key)
|
|
379
395
|
{
|
|
380
396
|
entry.Value.RemoveAt(i);
|
|
397
|
+
if (entry.Value.Count == 0)
|
|
398
|
+
{
|
|
399
|
+
_matchingDecorations.Remove(entry.Key);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
stopLooping = true;
|
|
381
403
|
break;
|
|
382
404
|
}
|
|
405
|
+
|
|
383
406
|
entry.Value[i] = (tag, editorOnly, predicate, format);
|
|
384
407
|
return true;
|
|
385
408
|
}
|
|
386
409
|
return false;
|
|
387
410
|
}
|
|
411
|
+
|
|
412
|
+
if (stopLooping)
|
|
413
|
+
{
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
388
416
|
}
|
|
389
417
|
|
|
390
418
|
if (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
namespace UnityHelpers.Core.Helper
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Core.Helper
|
|
2
2
|
{
|
|
3
3
|
using System;
|
|
4
4
|
using Extension;
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
using UnityEditor;
|
|
10
10
|
using UnityEditor.SceneManagement;
|
|
11
11
|
#endif
|
|
12
|
-
|
|
13
12
|
public static partial class Helpers
|
|
14
13
|
{
|
|
15
14
|
public static T Find<T>(this Object component, string tag, bool log = true)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
namespace UnityHelpers.Core.Helper
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Core.Helper
|
|
2
2
|
{
|
|
3
3
|
using System;
|
|
4
4
|
using System.Collections;
|
|
@@ -17,6 +17,29 @@
|
|
|
17
17
|
private static readonly Dictionary<Type, Func<IList>> ListCreators = new();
|
|
18
18
|
private static readonly Dictionary<Type, Func<int, IList>> ListWithCapacityCreators = new();
|
|
19
19
|
|
|
20
|
+
public static bool IsAttributeDefined<T>(
|
|
21
|
+
this ICustomAttributeProvider provider,
|
|
22
|
+
out T attribute,
|
|
23
|
+
bool inherit = true
|
|
24
|
+
)
|
|
25
|
+
where T : Attribute
|
|
26
|
+
{
|
|
27
|
+
try
|
|
28
|
+
{
|
|
29
|
+
if (provider.IsDefined(typeof(T), inherit))
|
|
30
|
+
{
|
|
31
|
+
attribute = (T)provider.GetCustomAttributes(typeof(T), inherit)[0];
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
catch
|
|
36
|
+
{
|
|
37
|
+
// Swallow
|
|
38
|
+
}
|
|
39
|
+
attribute = default;
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
|
|
20
43
|
public static Dictionary<string, PropertyInfo> LoadStaticPropertiesForType<T>()
|
|
21
44
|
{
|
|
22
45
|
Type type = typeof(T);
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
namespace UnityHelpers.Core.Helper
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Core.Helper
|
|
2
2
|
{
|
|
3
3
|
using System;
|
|
4
4
|
using System.Collections.Concurrent;
|
|
5
|
+
using UnityEditor;
|
|
5
6
|
using UnityEngine;
|
|
6
7
|
using Utils;
|
|
7
|
-
#if UNITY_EDITOR
|
|
8
|
-
using UnityEditor;
|
|
9
|
-
#endif
|
|
10
8
|
|
|
11
9
|
[ExecuteAlways]
|
|
12
10
|
public sealed class UnityMainThreadDispatcher : RuntimeSingleton<UnityMainThreadDispatcher>
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
namespace UnityHelpers.Core.Serialization.JsonConverters
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Core.Serialization.JsonConverters
|
|
2
2
|
{
|
|
3
3
|
using System;
|
|
4
4
|
using System.Text.Json;
|
|
5
5
|
using System.Text.Json.Serialization;
|
|
6
6
|
using UnityEngine;
|
|
7
|
-
using Object = UnityEngine.Object;
|
|
8
7
|
|
|
9
8
|
public sealed class GameObjectConverter : JsonConverter<GameObject>
|
|
10
9
|
{
|
package/Runtime/Utils/Buffers.cs
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Utils
|
|
2
|
+
{
|
|
3
|
+
using System;
|
|
4
|
+
using System.Collections.Generic;
|
|
5
|
+
|
|
6
|
+
public sealed class TypeNameSorter : IComparer<Type>
|
|
7
|
+
{
|
|
8
|
+
public static readonly TypeNameSorter Instance = new();
|
|
9
|
+
|
|
10
|
+
private TypeNameSorter() { }
|
|
11
|
+
|
|
12
|
+
public int Compare(Type x, Type y)
|
|
13
|
+
{
|
|
14
|
+
return string.Compare(x?.Name, y?.Name, StringComparison.OrdinalIgnoreCase);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
namespace UnityHelpers.Tests.Attributes
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Tests.Attributes
|
|
2
2
|
{
|
|
3
3
|
using System.Collections;
|
|
4
4
|
using System.Linq;
|
|
5
5
|
using Components;
|
|
6
|
-
using Core.Attributes;
|
|
7
6
|
using UnityEngine;
|
|
8
7
|
using UnityEngine.Assertions;
|
|
9
8
|
using UnityEngine.TestTools;
|
|
9
|
+
using WallstopStudios.UnityHelpers.Core.Attributes;
|
|
10
10
|
|
|
11
11
|
public sealed class ChildComponentTests
|
|
12
12
|
{
|