com.wallstop-studios.unity-helpers 2.1.1 → 2.1.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/AGENTS.md +1 -0
- package/Docs/ILIST_SORTING_PERFORMANCE.md +16 -16
- package/Docs/INDEX.md +1 -0
- package/Docs/RANDOM_PERFORMANCE.md +15 -15
- package/Docs/REFLECTION_HELPERS.md +84 -1
- package/Docs/REFLECTION_PERFORMANCE.md +169 -0
- package/{package-lock.json.meta → Docs/REFLECTION_PERFORMANCE.md.meta} +1 -1
- package/Docs/RELATIONAL_COMPONENTS.md +6 -0
- package/Docs/RELATIONAL_COMPONENT_PERFORMANCE.md +63 -0
- package/Docs/RELATIONAL_COMPONENT_PERFORMANCE.md.meta +7 -0
- package/Docs/SPATIAL_TREE_2D_PERFORMANCE.md +64 -64
- package/Docs/SPATIAL_TREE_3D_PERFORMANCE.md +64 -64
- package/Editor/Sprites/AnimationCopier.cs +1 -1
- package/Editor/Sprites/AnimationViewerWindow.cs +4 -4
- package/Editor/Sprites/SpriteSettingsApplierAPI.cs +2 -1
- package/Editor/Sprites/TextureResizerWizard.cs +4 -3
- package/Editor/Utils/ScriptableObjectSingletonCreator.cs +3 -3
- package/README.md +8 -3
- package/Runtime/Core/Attributes/BaseRelationalComponentAttribute.cs +147 -20
- package/Runtime/Core/Attributes/ChildComponentAttribute.cs +630 -117
- package/Runtime/Core/Attributes/NotNullAttribute.cs +5 -2
- package/Runtime/Core/Attributes/ParentComponentAttribute.cs +477 -103
- package/Runtime/Core/Attributes/RelationalComponentAssigner.cs +26 -3
- package/Runtime/Core/Attributes/RelationalComponentExtensions.cs +19 -3
- package/Runtime/Core/Attributes/SiblingComponentAttribute.cs +265 -92
- package/Runtime/Core/CodeGen.meta +8 -0
- package/Runtime/Core/DataStructure/ImmutableBitSet.cs +5 -20
- package/Runtime/Core/Helper/Helpers.cs +8 -0
- package/Runtime/Core/Helper/Logging/UnityLogTagFormatter.cs +11 -7
- package/Runtime/Core/Helper/Objects.cs +1 -1
- package/Runtime/Core/Helper/ReflectionHelpers.Factory.cs +5142 -0
- package/Runtime/Core/Helper/ReflectionHelpers.Factory.cs.meta +11 -0
- package/Runtime/Core/Helper/ReflectionHelpers.cs +1812 -1518
- package/Runtime/Core/Math/Line2D.cs +2 -4
- package/Runtime/Core/Math/Line3D.cs +2 -4
- package/Runtime/Core/Random/FlurryBurstRandom.cs +0 -6
- package/Runtime/Tags/AttributeMetadataCache.cs +4 -6
- package/Runtime/Tags/CosmeticEffectData.cs +1 -1
- package/Runtime/Visuals/UIToolkit/MultiFileSelectorElement.cs +3 -3
- package/Tests/Editor/Helper/HelpersTests.cs +2 -2
- package/Tests/Editor/Helper/ReflectionHelpersTypedEditorTests.cs +87 -0
- package/Tests/Editor/Helper/ReflectionHelpersTypedEditorTests.cs.meta +11 -0
- package/Tests/Editor/Helper/SpriteHelpersTests.cs +1 -1
- package/Tests/Editor/PrefabCheckerReportTests.cs +3 -3
- package/Tests/Editor/Sprites/AnimationCopierFilterTests.cs +18 -12
- package/Tests/Editor/Sprites/AnimationCopierWindowTests.cs +8 -7
- package/Tests/Editor/Sprites/AnimationViewerWindowTests.cs +2 -1
- package/Tests/Editor/Sprites/ScriptableSpriteAtlasEditorTests.cs +6 -5
- package/Tests/Editor/Sprites/SpriteCropperAdditionalTests.cs +2 -1
- package/Tests/Editor/Sprites/SpriteCropperTests.cs +7 -6
- package/Tests/Editor/Sprites/SpritePivotAdjusterAdditionalTests.cs +2 -1
- package/Tests/Editor/Sprites/SpritePivotAdjusterTests.cs +4 -3
- package/Tests/Editor/Sprites/TextureResizerWizardTests.cs +10 -9
- package/Tests/Editor/Sprites/TextureSettingsApplierAPITests.cs +2 -1
- package/Tests/Runtime/Helper/ObjectsTests.cs +1 -1
- package/Tests/Runtime/Helper/ReflectionHelperCapabilityMatrixTests.cs +2923 -0
- package/Tests/Runtime/Helper/ReflectionHelperCapabilityMatrixTests.cs.meta +11 -0
- package/Tests/Runtime/Helper/ReflectionHelperTests.cs +660 -0
- package/Tests/Runtime/Performance/ReflectionPerformanceTests.cs +1238 -0
- package/Tests/Runtime/Performance/ReflectionPerformanceTests.cs.meta +11 -0
- package/Tests/Runtime/Performance/RelationalComponentBenchmarkTests.cs +832 -0
- package/Tests/Runtime/Performance/RelationalComponentBenchmarkTests.cs.meta +11 -0
- package/package.json +1 -1
- package/Tests/Runtime/Performance/RelationComponentPerformanceTests.cs +0 -60
- package/Tests/Runtime/Performance/RelationComponentPerformanceTests.cs.meta +0 -3
|
@@ -5,6 +5,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
5
5
|
using NUnit.Framework;
|
|
6
6
|
using UnityEditor;
|
|
7
7
|
using UnityEngine;
|
|
8
|
+
using WallstopStudios.UnityHelpers.Core.Helper;
|
|
8
9
|
using WallstopStudios.UnityHelpers.Editor.Sprites;
|
|
9
10
|
using WallstopStudios.UnityHelpers.Tests.Editor.Utils;
|
|
10
11
|
|
|
@@ -31,7 +32,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
31
32
|
[Test]
|
|
32
33
|
public void ResizesTextureAccordingToMultipliers()
|
|
33
34
|
{
|
|
34
|
-
string path = Path.Combine(Root, "tex.png").
|
|
35
|
+
string path = Path.Combine(Root, "tex.png").SanitizePath();
|
|
35
36
|
CreatePng(path, 16, 10, Color.green);
|
|
36
37
|
AssetDatabase.Refresh();
|
|
37
38
|
|
|
@@ -59,7 +60,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
59
60
|
[Test]
|
|
60
61
|
public void DoesNothingWhenNumResizesIsZero()
|
|
61
62
|
{
|
|
62
|
-
string path = Path.Combine(Root, "nochange.png").
|
|
63
|
+
string path = Path.Combine(Root, "nochange.png").SanitizePath();
|
|
63
64
|
CreatePng(path, 12, 7, Color.blue);
|
|
64
65
|
AssetDatabase.Refresh();
|
|
65
66
|
int w0 = AssetDatabase.LoadAssetAtPath<Texture2D>(path).width;
|
|
@@ -80,7 +81,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
80
81
|
[Test]
|
|
81
82
|
public void RespectsDryRunAndDoesNotModifyFile()
|
|
82
83
|
{
|
|
83
|
-
string path = Path.Combine(Root, "dry.png").
|
|
84
|
+
string path = Path.Combine(Root, "dry.png").SanitizePath();
|
|
84
85
|
CreatePng(path, 10, 6, Color.white);
|
|
85
86
|
AssetDatabase.Refresh();
|
|
86
87
|
|
|
@@ -108,7 +109,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
108
109
|
[Test]
|
|
109
110
|
public void WritesToOutputFolderLeavingOriginalUnchanged()
|
|
110
111
|
{
|
|
111
|
-
string path = Path.Combine(Root, "out.png").
|
|
112
|
+
string path = Path.Combine(Root, "out.png").SanitizePath();
|
|
112
113
|
CreatePng(path, 8, 4, Color.black);
|
|
113
114
|
AssetDatabase.Refresh();
|
|
114
115
|
|
|
@@ -134,7 +135,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
134
135
|
Assert.That(orig.width, Is.EqualTo(8));
|
|
135
136
|
Assert.That(orig.height, Is.EqualTo(4));
|
|
136
137
|
|
|
137
|
-
string outPath = Path.Combine(OutRoot, "out.png").
|
|
138
|
+
string outPath = Path.Combine(OutRoot, "out.png").SanitizePath();
|
|
138
139
|
Texture2D outTex = AssetDatabase.LoadAssetAtPath<Texture2D>(outPath);
|
|
139
140
|
Assert.IsTrue(outTex != null, "Expected resized texture in output folder");
|
|
140
141
|
Assert.That(outTex.width, Is.EqualTo(16));
|
|
@@ -144,7 +145,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
144
145
|
[Test]
|
|
145
146
|
public void MultiplePassesAccumulateSize()
|
|
146
147
|
{
|
|
147
|
-
string path = Path.Combine(Root, "multi.png").
|
|
148
|
+
string path = Path.Combine(Root, "multi.png").SanitizePath();
|
|
148
149
|
CreatePng(path, 16, 10, Color.gray);
|
|
149
150
|
AssetDatabase.Refresh();
|
|
150
151
|
|
|
@@ -171,7 +172,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
171
172
|
[Test]
|
|
172
173
|
public void RestoresImporterReadabilityAfterRun()
|
|
173
174
|
{
|
|
174
|
-
string path = Path.Combine(Root, "restore.png").
|
|
175
|
+
string path = Path.Combine(Root, "restore.png").SanitizePath();
|
|
175
176
|
CreatePng(path, 8, 8, Color.red);
|
|
176
177
|
AssetDatabase.Refresh();
|
|
177
178
|
|
|
@@ -217,7 +218,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
217
218
|
|
|
218
219
|
private static void CreatePng(string relPath, int w, int h, Color c)
|
|
219
220
|
{
|
|
220
|
-
string dir = Path.GetDirectoryName(relPath).
|
|
221
|
+
string dir = Path.GetDirectoryName(relPath).SanitizePath();
|
|
221
222
|
EnsureFolder(dir);
|
|
222
223
|
Texture2D t = new(w, h, TextureFormat.RGBA32, false);
|
|
223
224
|
Color[] pix = new Color[w * h];
|
|
@@ -241,7 +242,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
241
242
|
),
|
|
242
243
|
rel
|
|
243
244
|
)
|
|
244
|
-
.
|
|
245
|
+
.SanitizePath();
|
|
245
246
|
}
|
|
246
247
|
}
|
|
247
248
|
#endif
|
|
@@ -5,6 +5,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
5
5
|
using NUnit.Framework;
|
|
6
6
|
using UnityEditor;
|
|
7
7
|
using UnityEngine;
|
|
8
|
+
using WallstopStudios.UnityHelpers.Core.Helper;
|
|
8
9
|
using WallstopStudios.UnityHelpers.Editor.Sprites;
|
|
9
10
|
using WallstopStudios.UnityHelpers.Tests.Editor.Utils;
|
|
10
11
|
|
|
@@ -32,7 +33,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
32
33
|
[Test]
|
|
33
34
|
public void AppliesDefaultPlatformSettingsViaAPI()
|
|
34
35
|
{
|
|
35
|
-
string texPath = (Root + "/api_tex.png").
|
|
36
|
+
string texPath = (Root + "/api_tex.png").SanitizePath();
|
|
36
37
|
CreatePng(texPath, 16, 16, Color.white);
|
|
37
38
|
AssetDatabase.Refresh();
|
|
38
39
|
|
|
@@ -293,7 +293,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Helper
|
|
|
293
293
|
CustomClass[] array = { a, b, c };
|
|
294
294
|
ReadOnlySpan<CustomClass> span = array;
|
|
295
295
|
|
|
296
|
-
int spanHash = Objects.
|
|
296
|
+
int spanHash = Objects.SpanHashCode(span);
|
|
297
297
|
int variadicHash = Objects.HashCode(a, b, c);
|
|
298
298
|
|
|
299
299
|
Assert.AreEqual(variadicHash, spanHash);
|