com.wallstop-studios.unity-helpers 2.0.0-rc81.9 → 2.0.1
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/.editorconfig +1 -1
- package/.gitattributes +1 -1
- package/.githooks/pre-commit +31 -5
- package/.githooks/pre-push +50 -0
- package/.github/dependabot.yml +24 -2
- package/.github/scripts/check-markdown-links.ps1 +77 -0
- package/.github/scripts/check_markdown_links.py +89 -0
- package/.github/scripts/check_markdown_url_encoding.py +74 -0
- package/.github/scripts/validate_markdown_links.py +194 -0
- package/.github/workflows/csharpier-autofix.yml +152 -0
- package/.github/workflows/format-on-demand.yml +305 -0
- package/.github/workflows/lint-doc-links.yml +8 -5
- package/.github/workflows/markdown-json.yml +6 -2
- package/.github/workflows/npm-publish.yml +1 -1
- package/.github/workflows/prettier-autofix.yml +195 -0
- package/.github/workflows/update-dotnet-tools.yml +80 -0
- package/.github/workflows/yaml-format-lint.yml +41 -0
- package/.lychee.toml +4 -4
- package/.markdownlint.jsonc +21 -0
- package/.pre-commit-config.yaml +11 -3
- package/.yamllint.yaml +31 -0
- package/AGENTS.md +5 -1
- package/Docs/CHANGELOG.md +11 -0
- package/Docs/CONTRIBUTING.md +49 -0
- package/Docs/CONTRIBUTING.md.meta +7 -0
- package/{EDITOR_TOOLS_GUIDE.md → Docs/EDITOR_TOOLS_GUIDE.md} +4 -0
- package/Docs/EFFECTS_SYSTEM.md +1316 -0
- package/{EFFECTS_SYSTEM_TUTORIAL.md → Docs/EFFECTS_SYSTEM_TUTORIAL.md} +1 -1
- package/{GETTING_STARTED.md → Docs/GETTING_STARTED.md} +50 -64
- package/{GLOSSARY.md → Docs/GLOSSARY.md} +4 -4
- package/Docs/HELPER_UTILITIES.md +885 -0
- package/Docs/HELPER_UTILITIES.md.meta +7 -0
- package/{INDEX.md → Docs/INDEX.md} +107 -62
- package/Docs/MATH_AND_EXTENSIONS.md +1039 -0
- package/{RANDOM_PERFORMANCE.md → Docs/RANDOM_PERFORMANCE.md} +15 -15
- package/{RELATIONAL_COMPONENTS.md → Docs/RELATIONAL_COMPONENTS.md} +111 -84
- package/{SERIALIZATION.md → Docs/SERIALIZATION.md} +15 -0
- package/{SPATIAL_TREES_2D_GUIDE.md → Docs/SPATIAL_TREES_2D_GUIDE.md} +2 -2
- package/{SPATIAL_TREES_3D_GUIDE.md → Docs/SPATIAL_TREES_3D_GUIDE.md} +1 -1
- package/Docs/SPATIAL_TREE_2D_PERFORMANCE.md +241 -0
- package/Docs/SPATIAL_TREE_3D_PERFORMANCE.md +243 -0
- package/{THIRD_PARTY_NOTICES.md → Docs/THIRD_PARTY_NOTICES.md} +1 -1
- package/Docs/UTILITY_COMPONENTS.md +906 -0
- package/Docs/UTILITY_COMPONENTS.md.meta +7 -0
- package/Docs/VISUAL_COMPONENTS.md +337 -0
- package/Docs/VISUAL_COMPONENTS.md.meta +7 -0
- package/Editor/AnimationEventEditor.cs +337 -160
- package/Editor/Core/Helper/AnimationEventHelpers.cs +178 -152
- package/Editor/CustomEditors/PersistentDirectoryGUI.cs +20 -11
- package/Editor/CustomEditors/TexturePlatformOverrideEntryDrawer.cs +11 -2
- package/Editor/FitTextureSizeWindow.cs +43 -19
- package/Editor/PersistentDirectorySettings.cs +64 -12
- package/Editor/PrefabChecker.cs +72 -5
- package/Editor/Sprites/AnimationCopier.cs +131 -55
- package/Editor/Sprites/AnimationCreator.cs +63 -22
- package/Editor/Sprites/AnimationViewerWindow.cs +42 -6
- package/Editor/Sprites/TexturePlatformNameHelper.cs +50 -39
- package/Editor/Sprites/TextureResizerWizard.cs +23 -1
- package/Editor/Sprites/TextureSettingsApplierWindow.cs +148 -85
- package/Editor/Tools/ImageBlurTool.cs +81 -10
- package/Editor/Utils/EditorUi.cs +1 -1
- package/Editor/Utils/ScriptableObjectSingletonCreator.cs +1 -1
- package/README.md +428 -2433
- package/Runtime/AssemblyInfo.cs +4 -0
- package/Runtime/Core/Attributes/NotNullAttribute.cs +1 -3
- package/Runtime/Core/Attributes/RelationalComponentAssigner.cs +50 -5
- package/Runtime/Core/DataStructure/CyclicBuffer.cs +0 -1
- package/Runtime/Core/DataStructure/KDTree3D.cs +1 -1
- package/Runtime/Core/DataStructure/OctTree3D.cs +1 -1
- package/Runtime/Core/Extension/AsyncOperationExtensions.cs +122 -0
- package/Runtime/Core/Extension/RandomExtensions.cs +68 -0
- package/Runtime/Core/Extension/WallstopStudiosLogger.cs +16 -0
- package/Runtime/Core/Helper/Partials/ObjectHelpers.cs +4 -1
- package/Runtime/Core/Helper/ReflectionHelpers.cs +21 -10
- package/Runtime/Core/Helper/SpriteHelpers.cs +3 -1
- package/Runtime/Core/Helper/UnityMainThreadDispatcher.cs +45 -1
- package/Runtime/Core/Serialization/JsonConverters/GameObjectConverter.cs +13 -5
- package/Runtime/Core/Serialization/JsonConverters/ResolutionConverter.cs +1 -1
- package/Runtime/Core/Serialization/JsonConverters/TypeConverter.cs +1 -1
- package/Runtime/Core/Serialization/ProtobufUnitySurrogates.cs +24 -29
- package/Runtime/Core/Serialization/Serializer.cs +101 -0
- package/Runtime/Integrations/Reflex/AssemblyInfo.cs +7 -0
- package/Runtime/Integrations/Reflex/AssemblyInfo.cs.meta +11 -0
- package/Runtime/Integrations/Reflex/ContainerRelationalExtensions.cs +198 -0
- package/Runtime/Integrations/Reflex/ContainerRelationalExtensions.cs.meta +11 -0
- package/Runtime/Integrations/Reflex/RelationalComponentsInstaller.cs +86 -0
- package/Runtime/Integrations/Reflex/RelationalComponentsInstaller.cs.meta +11 -0
- package/Runtime/Integrations/Reflex/RelationalReflexSceneBootstrapper.cs +316 -0
- package/Runtime/Integrations/Reflex/RelationalReflexSceneBootstrapper.cs.meta +11 -0
- package/Runtime/Integrations/Reflex/RelationalSceneAssignmentOptions.cs +86 -0
- package/Runtime/Integrations/Reflex/RelationalSceneAssignmentOptions.cs.meta +11 -0
- package/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Integration.Reflex.asmdef +20 -0
- package/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Integration.Reflex.asmdef.meta +7 -0
- package/Runtime/Integrations/Reflex.meta +8 -0
- package/Runtime/Integrations/VContainer/AssemblyInfo.cs +9 -0
- package/Runtime/Integrations/VContainer/AssemblyInfo.cs.meta +3 -0
- package/Runtime/Integrations/VContainer/ObjectResolverRelationalExtensions.cs +96 -0
- package/Runtime/Integrations/VContainer/RelationalComponentEntryPoint.cs +90 -10
- package/Runtime/Integrations/VContainer/RelationalComponentsBuilderExtensions.cs +13 -1
- package/Runtime/Integrations/VContainer/RelationalObjectPools.cs +114 -0
- package/Runtime/Integrations/VContainer/RelationalObjectPools.cs.meta +11 -0
- package/Runtime/Integrations/VContainer/RelationalSceneAssignmentOptions.cs +16 -4
- package/Runtime/Integrations/VContainer/RelationalSceneLoadListener.cs +241 -0
- package/Runtime/Integrations/VContainer/RelationalSceneLoadListener.cs.meta +11 -0
- package/Runtime/Integrations/Zenject/AssemblyInfo.cs +9 -0
- package/Runtime/Integrations/Zenject/AssemblyInfo.cs.meta +3 -0
- package/Runtime/Integrations/Zenject/DiContainerRelationalExtensions.cs +69 -2
- package/Runtime/Integrations/Zenject/RelationalComponentSceneInitializer.cs +89 -12
- package/Runtime/Integrations/Zenject/RelationalComponentsInstaller.cs +23 -1
- package/Runtime/Integrations/Zenject/RelationalMemoryPools.cs +44 -0
- package/Runtime/Integrations/Zenject/RelationalMemoryPools.cs.meta +11 -0
- package/Runtime/Integrations/Zenject/RelationalSceneAssignmentOptions.cs +16 -10
- package/Runtime/Integrations/Zenject/RelationalSceneLoadListener.cs +243 -0
- package/Runtime/Integrations/Zenject/RelationalSceneLoadListener.cs.meta +11 -0
- package/Runtime/Tags/AttributeMetadataCache.cs +1 -4
- package/Runtime/Utils/Buffers.cs +4 -4
- package/Runtime/Utils/ScriptableObjectSingleton.cs +1 -2
- package/Runtime/Utils/SetTextureImportData.cs +3 -1
- package/Runtime/Utils/TextureScale.cs +10 -2
- package/Runtime/Visuals/UGUI/EnhancedImage.cs +6 -0
- package/Runtime/Visuals/UIToolkit/LayeredImage.cs +4 -1
- package/Samples~/DI - Reflex/README.md +527 -0
- package/Samples~/DI - Reflex/README.md.meta +7 -0
- package/Samples~/DI - Reflex/Scripts/ReflexPaletteService.cs +36 -0
- package/Samples~/DI - Reflex/Scripts/ReflexPaletteService.cs.meta +11 -0
- package/Samples~/DI - Reflex/Scripts/ReflexRelationalConsumer.cs +79 -0
- package/Samples~/DI - Reflex/Scripts/ReflexRelationalConsumer.cs.meta +11 -0
- package/Samples~/DI - Reflex/Scripts/ReflexSampleInstaller.cs +30 -0
- package/Samples~/DI - Reflex/Scripts/ReflexSampleInstaller.cs.meta +11 -0
- package/Samples~/DI - Reflex/Scripts/ReflexSpawner.cs +79 -0
- package/Samples~/DI - Reflex/Scripts/ReflexSpawner.cs.meta +11 -0
- package/Samples~/DI - Reflex/Scripts/Samples.UnityHelpers.DI.Reflex.asmdef +26 -0
- package/Samples~/DI - Reflex/Scripts/Samples.UnityHelpers.DI.Reflex.asmdef.meta +9 -0
- package/Samples~/DI - Reflex/Scripts.meta +8 -0
- package/Samples~/DI - Reflex.meta +8 -0
- package/Samples~/DI - VContainer/README.md +238 -56
- package/Samples~/DI - VContainer/Scripts/GameLifetimeScope.cs +22 -4
- package/Samples~/DI - VContainer/Scripts/RelationalConsumer.cs +5 -2
- package/Samples~/DI - VContainer/Scripts/Spawner.cs +113 -4
- package/Samples~/DI - Zenject/README.md +223 -58
- package/Samples~/DI - Zenject/Scripts/RelationalConsumer.cs +3 -0
- package/Samples~/DI - Zenject/Scripts/RelationalConsumerPool.cs +37 -0
- package/Samples~/DI - Zenject/Scripts/RelationalConsumerPool.cs.meta +12 -0
- package/Samples~/DI - Zenject/Scripts/SpawnerZenject.cs +74 -3
- package/Samples~/Random - PRNG/README.md +2 -1
- package/Samples~/Relational Components - Basic/README.md +3 -1
- package/Samples~/Serialization - JSON/README.md +2 -1
- package/Samples~/Spatial Structures - 2D and 3D/README.md +2 -1
- package/Samples~/UGUI - EnhancedImage/README.md +2 -1
- package/Samples~/UI Toolkit - MultiFile Selector (Editor)/README.md +2 -1
- package/Tests/Editor/Attributes/AnimationEventHelpersTests.cs +16 -0
- package/Tests/Editor/Core/Attributes/RelationalComponentAssignerTests.cs +32 -34
- package/Tests/Editor/Integrations/Reflex/ReflexIntegrationCompilationTests.cs +41 -0
- package/Tests/Editor/Integrations/Reflex/ReflexIntegrationCompilationTests.cs.meta +11 -0
- package/Tests/Editor/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Editor.Reflex.asmdef +27 -0
- package/Tests/Editor/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Editor.Reflex.asmdef.meta +7 -0
- package/Tests/Editor/Integrations/Reflex.meta +8 -0
- package/Tests/Editor/Integrations/VContainer/VContainerRelationalEntryPointTests.cs +21 -18
- package/Tests/Editor/Integrations/VContainer/VContainerRelationalHelpersTests.cs +164 -0
- package/Tests/Editor/Integrations/VContainer/VContainerRelationalHelpersTests.cs.meta +11 -0
- package/Tests/Editor/Integrations/VContainer/WallstopStudios.UnityHelpers.Tests.Editor.VContainer.asmdef +2 -1
- package/Tests/Editor/Integrations/Zenject/WallstopStudios.UnityHelpers.Tests.Editor.Zenject.asmdef +3 -2
- package/Tests/Editor/Integrations/Zenject/ZenjectRelationalHelpersTests.cs +127 -0
- package/Tests/Editor/Integrations/Zenject/ZenjectRelationalHelpersTests.cs.meta +11 -0
- package/Tests/Editor/Integrations/Zenject/ZenjectRelationalInitializerTests.cs +25 -23
- package/Tests/Editor/PersistentDirectorySettingsTests.cs +58 -0
- package/Tests/Editor/PersistentDirectorySettingsTests.cs.meta +11 -0
- package/Tests/Editor/PrefabCheckerReportTests.cs +32 -0
- package/Tests/Editor/PrefabCheckerReportTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/AnimationCopierFilterTests.cs +63 -0
- package/Tests/Editor/Sprites/AnimationCopierFilterTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/AnimationCopierWindowTests.cs +1 -1
- package/Tests/Editor/Sprites/AnimationViewerWindowTests.cs +38 -0
- package/Tests/Editor/Sprites/AnimationViewerWindowTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/ScriptableSpriteAtlasEditorTests.cs +1 -1
- package/Tests/Editor/Sprites/SpriteCropperAdditionalTests.cs +12 -12
- package/Tests/Editor/Sprites/SpriteCropperTests.cs +9 -9
- package/Tests/Editor/Sprites/SpritePivotAdjusterTests.cs +3 -3
- package/Tests/Editor/Sprites/TexturePlatformNameHelperTests.cs +18 -0
- package/Tests/Editor/Sprites/TextureResizerWizardTests.cs +5 -5
- package/Tests/Editor/Sprites/TextureSettingsApplierAPITests.cs +3 -3
- package/Tests/Editor/Sprites/TextureSettingsApplierWizardAdditionalTests.cs +4 -4
- package/Tests/Editor/Sprites/TextureSettingsApplierWizardTests.cs +4 -4
- package/Tests/Editor/Tools/ImageBlurToolTests.cs +22 -110
- package/Tests/Editor/Utils/CommonTestBase.cs +60 -1
- package/Tests/Editor/Utils/ScriptableObjectSingletonCreatorTests.cs +6 -6
- package/Tests/Editor/Windows/FitTextureSizeWindowTests.cs +66 -74
- package/Tests/Runtime/Attributes/RelationalComponentInitializerTests.cs +4 -15
- package/Tests/Runtime/DataStructures/SpatialTree3DBoundsConsistencyTests.cs +29 -29
- package/Tests/Runtime/Extensions/AsyncOperationExtensionsTests.cs +179 -0
- package/Tests/Runtime/Extensions/RandomExtensionTests.cs +55 -0
- package/Tests/Runtime/Integrations/Reflex/RelationalComponentsReflexTests.cs +445 -0
- package/Tests/Runtime/Integrations/Reflex/RelationalComponentsReflexTests.cs.meta +11 -0
- package/Tests/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Runtime.Reflex.asmdef +28 -0
- package/Tests/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Runtime.Reflex.asmdef.meta +7 -0
- package/Tests/Runtime/Integrations/Reflex.meta +8 -0
- package/Tests/Runtime/Integrations/VContainer/RelationalComponentsVContainerTests.cs +257 -221
- package/Tests/Runtime/Integrations/VContainer/RelationalObjectPoolsVContainerTests.cs +91 -0
- package/Tests/Runtime/Integrations/VContainer/RelationalObjectPoolsVContainerTests.cs.meta +11 -0
- package/Tests/Runtime/Integrations/Zenject/RelationalComponentsZenjectTests.cs +251 -233
- package/Tests/Runtime/Performance/RandomPerformanceTests.cs +1 -1
- package/Tests/Runtime/Performance/SpatialTree2DPerformanceTests.cs +6 -1
- package/Tests/Runtime/Performance/SpatialTree3DPerformanceTests.cs +4 -1
- package/Tests/Runtime/Serialization/JsonConverterAdditionalTests.cs +30 -0
- package/Tests/Runtime/Serialization/JsonConverterAdditionalTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/JsonConverterTests.cs +8 -12
- package/Tests/Runtime/Serialization/JsonRoundtripComprehensiveTests.cs +4 -9
- package/Tests/Runtime/Serialization/JsonSerializationTest.cs +16 -5
- package/Tests/Runtime/Serialization/ProtoRoundtripComprehensiveTests.cs +13 -13
- package/Tests/Runtime/Serialization/SerializerAdditionalTests.cs +12 -0
- package/Tests/Runtime/Serialization/SerializerFileIoTests.cs +105 -0
- package/Tests/Runtime/Serialization/SerializerFileIoTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/UnityEngineObjectJsonTests.cs +247 -0
- package/Tests/Runtime/Serialization/UnityEngineObjectJsonTests.cs.meta +11 -0
- package/Tests/Runtime/TestUtils/CommonTestBase.cs +99 -0
- package/Tests/Runtime/TestUtils/ReflexTestSupport.cs +111 -0
- package/Tests/Runtime/TestUtils/ReflexTestSupport.cs.meta +12 -0
- package/Tests/Runtime/Utils/CoroutineHandlerTests.cs +1 -1
- package/Tests/Runtime/Utils/LZMAComprehensiveTests.cs +1 -1
- package/Tests/Runtime/Utils/LZMATests.cs +1 -1
- package/Tests/Runtime/Utils/MatchColliderToSpriteTests.cs +5 -5
- package/Tests/Runtime/Visuals/EnhancedImageTests.cs +25 -56
- package/Tests/Runtime/Visuals/VisualsTestHelpers.cs +1 -8
- package/Tests/TestUtils.meta +8 -0
- package/package-lock.json.meta +7 -0
- package/package.json +13 -4
- package/scripts/check-eol.ps1 +4 -5
- package/scripts/lint-tests.ps1 +156 -0
- package/scripts/lint-tests.ps1.meta +7 -0
- package/scripts/normalize-eol.ps1 +6 -9
- package/.github/workflows/csharpier.yml +0 -135
- package/CHANGELOG.md +0 -0
- package/EFFECTS_SYSTEM.md +0 -242
- package/MATH_AND_EXTENSIONS.md +0 -316
- package/SPATIAL_TREE_2D_PERFORMANCE.md +0 -238
- package/SPATIAL_TREE_3D_PERFORMANCE.md +0 -240
- /package/{CHANGELOG.md.meta → Docs/CHANGELOG.md.meta} +0 -0
- /package/{DATA_STRUCTURES.md → Docs/DATA_STRUCTURES.md} +0 -0
- /package/{DATA_STRUCTURES.md.meta → Docs/DATA_STRUCTURES.md.meta} +0 -0
- /package/{EDITOR_TOOLS_GUIDE.md.meta → Docs/EDITOR_TOOLS_GUIDE.md.meta} +0 -0
- /package/{EFFECTS_SYSTEM.md.meta → Docs/EFFECTS_SYSTEM.md.meta} +0 -0
- /package/{EFFECTS_SYSTEM_TUTORIAL.md.meta → Docs/EFFECTS_SYSTEM_TUTORIAL.md.meta} +0 -0
- /package/{GETTING_STARTED.md.meta → Docs/GETTING_STARTED.md.meta} +0 -0
- /package/{GLOSSARY.md.meta → Docs/GLOSSARY.md.meta} +0 -0
- /package/{HULLS.md → Docs/HULLS.md} +0 -0
- /package/{HULLS.md.meta → Docs/HULLS.md.meta} +0 -0
- /package/{INDEX.md.meta → Docs/INDEX.md.meta} +0 -0
- /package/{LICENSE.md → Docs/LICENSE.md} +0 -0
- /package/{LICENSE.md.meta → Docs/LICENSE.md.meta} +0 -0
- /package/{MATH_AND_EXTENSIONS.md.meta → Docs/MATH_AND_EXTENSIONS.md.meta} +0 -0
- /package/{RANDOM_PERFORMANCE.md.meta → Docs/RANDOM_PERFORMANCE.md.meta} +0 -0
- /package/{REFLECTION_HELPERS.md → Docs/REFLECTION_HELPERS.md} +0 -0
- /package/{REFLECTION_HELPERS.md.meta → Docs/REFLECTION_HELPERS.md.meta} +0 -0
- /package/{RELATIONAL_COMPONENTS.md.meta → Docs/RELATIONAL_COMPONENTS.md.meta} +0 -0
- /package/{SERIALIZATION.md.meta → Docs/SERIALIZATION.md.meta} +0 -0
- /package/{SINGLETONS.md → Docs/SINGLETONS.md} +0 -0
- /package/{SINGLETONS.md.meta → Docs/SINGLETONS.md.meta} +0 -0
- /package/{SPATIAL_TREES_2D_GUIDE.md.meta → Docs/SPATIAL_TREES_2D_GUIDE.md.meta} +0 -0
- /package/{SPATIAL_TREES_3D_GUIDE.md.meta → Docs/SPATIAL_TREES_3D_GUIDE.md.meta} +0 -0
- /package/{SPATIAL_TREE_2D_PERFORMANCE.md.meta → Docs/SPATIAL_TREE_2D_PERFORMANCE.md.meta} +0 -0
- /package/{SPATIAL_TREE_3D_PERFORMANCE.md.meta → Docs/SPATIAL_TREE_3D_PERFORMANCE.md.meta} +0 -0
- /package/{SPATIAL_TREE_SEMANTICS.md → Docs/SPATIAL_TREE_SEMANTICS.md} +0 -0
- /package/{SPATIAL_TREE_SEMANTICS.md.meta → Docs/SPATIAL_TREE_SEMANTICS.md.meta} +0 -0
- /package/{THIRD_PARTY_NOTICES.md.meta → Docs/THIRD_PARTY_NOTICES.md.meta} +0 -0
|
@@ -11,32 +11,19 @@ namespace WallstopStudios.UnityHelpers.Tests.Integrations.Zenject
|
|
|
11
11
|
using WallstopStudios.UnityHelpers.Core.Attributes;
|
|
12
12
|
using WallstopStudios.UnityHelpers.Integrations.Zenject;
|
|
13
13
|
using WallstopStudios.UnityHelpers.Tags;
|
|
14
|
+
using WallstopStudios.UnityHelpers.Tests.TestUtils;
|
|
14
15
|
|
|
15
|
-
public sealed class RelationalComponentsZenjectTests
|
|
16
|
+
public sealed class RelationalComponentsZenjectTests : CommonTestBase
|
|
16
17
|
{
|
|
17
18
|
private DiContainer Container;
|
|
18
19
|
|
|
19
20
|
[SetUp]
|
|
20
21
|
public void Setup()
|
|
21
22
|
{
|
|
23
|
+
ReflexTestSupport.EnsureReflexSettings();
|
|
22
24
|
Container = new DiContainer();
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
private readonly List<GameObject> _spawned = new();
|
|
26
|
-
|
|
27
|
-
[TearDown]
|
|
28
|
-
public void Cleanup()
|
|
29
|
-
{
|
|
30
|
-
for (int i = 0; i < _spawned.Count; i++)
|
|
31
|
-
{
|
|
32
|
-
if (_spawned[i] != null)
|
|
33
|
-
{
|
|
34
|
-
UnityEngine.Object.DestroyImmediate(_spawned[i]);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
_spawned.Clear();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
27
|
[Test]
|
|
41
28
|
public void ContainerExtensionsUseBoundAssigner()
|
|
42
29
|
{
|
|
@@ -57,14 +44,12 @@ namespace WallstopStudios.UnityHelpers.Tests.Integrations.Zenject
|
|
|
57
44
|
Is.SameAs(tester),
|
|
58
45
|
"Assigner should receive the same component instance"
|
|
59
46
|
);
|
|
60
|
-
Assert.
|
|
61
|
-
tester.parentBody,
|
|
62
|
-
Is.Not.Null,
|
|
47
|
+
Assert.IsTrue(
|
|
48
|
+
tester.parentBody != null,
|
|
63
49
|
"ParentComponent assignment should set parentBody"
|
|
64
50
|
);
|
|
65
|
-
Assert.
|
|
66
|
-
tester.childCollider,
|
|
67
|
-
Is.Not.Null,
|
|
51
|
+
Assert.IsTrue(
|
|
52
|
+
tester.childCollider != null,
|
|
68
53
|
"ChildComponent assignment should set childCollider"
|
|
69
54
|
);
|
|
70
55
|
}
|
|
@@ -76,14 +61,12 @@ namespace WallstopStudios.UnityHelpers.Tests.Integrations.Zenject
|
|
|
76
61
|
|
|
77
62
|
Container.AssignRelationalComponents(tester);
|
|
78
63
|
|
|
79
|
-
Assert.
|
|
80
|
-
tester.parentBody,
|
|
81
|
-
Is.Not.Null,
|
|
64
|
+
Assert.IsTrue(
|
|
65
|
+
tester.parentBody != null,
|
|
82
66
|
"Fallback should assign parentBody without a bound assigner"
|
|
83
67
|
);
|
|
84
|
-
Assert.
|
|
85
|
-
tester.childCollider,
|
|
86
|
-
Is.Not.Null,
|
|
68
|
+
Assert.IsTrue(
|
|
69
|
+
tester.childCollider != null,
|
|
87
70
|
"Fallback should assign childCollider without a bound assigner"
|
|
88
71
|
);
|
|
89
72
|
}
|
|
@@ -92,126 +75,194 @@ namespace WallstopStudios.UnityHelpers.Tests.Integrations.Zenject
|
|
|
92
75
|
public System.Collections.IEnumerator SceneInitializerAssignsActiveSceneComponents()
|
|
93
76
|
{
|
|
94
77
|
AttributeMetadataCache cache = CreateCacheFor(typeof(ZenjectRelationalTester));
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
Is.SameAs(tester),
|
|
122
|
-
"Initializer should target the created tester instance"
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
finally
|
|
126
|
-
{
|
|
127
|
-
if (cache != null)
|
|
128
|
-
{
|
|
129
|
-
UnityEngine.Object.DestroyImmediate(cache);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
78
|
+
Container.BindInstance(cache);
|
|
79
|
+
RecordingAssigner assigner = new();
|
|
80
|
+
Container.Bind<IRelationalComponentAssigner>().FromInstance(assigner);
|
|
81
|
+
Container.BindInstance(RelationalSceneAssignmentOptions.Default);
|
|
82
|
+
Container.BindInterfacesTo<RelationalComponentSceneInitializer>().AsSingle();
|
|
83
|
+
|
|
84
|
+
Scene scene = CreateTempScene("ZenjectTestScene_Active");
|
|
85
|
+
ZenjectRelationalTester tester = CreateHierarchy();
|
|
86
|
+
GameObject root = tester.transform.root.gameObject;
|
|
87
|
+
SceneManager.MoveGameObjectToScene(root, scene);
|
|
88
|
+
yield return null;
|
|
89
|
+
|
|
90
|
+
IInitializable initializer = Container.Resolve<IInitializable>();
|
|
91
|
+
initializer.Initialize();
|
|
92
|
+
yield return null;
|
|
93
|
+
|
|
94
|
+
Assert.That(
|
|
95
|
+
assigner.CallCount,
|
|
96
|
+
Is.EqualTo(1),
|
|
97
|
+
"Initializer should invoke assigner exactly once for the tester component"
|
|
98
|
+
);
|
|
99
|
+
Assert.That(
|
|
100
|
+
assigner.LastComponent,
|
|
101
|
+
Is.SameAs(tester),
|
|
102
|
+
"Initializer should target the created tester instance"
|
|
103
|
+
);
|
|
132
104
|
}
|
|
133
105
|
|
|
134
106
|
[UnityTest]
|
|
135
107
|
public System.Collections.IEnumerator SceneInitializerSkipsInactiveWhenOptionDisabled()
|
|
136
108
|
{
|
|
137
109
|
AttributeMetadataCache cache = CreateCacheFor(typeof(ZenjectRelationalTester));
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
Is.EqualTo(0),
|
|
161
|
-
"Initializer should skip inactive tester when IncludeInactive is false"
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
finally
|
|
165
|
-
{
|
|
166
|
-
if (cache != null)
|
|
167
|
-
{
|
|
168
|
-
UnityEngine.Object.DestroyImmediate(cache);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
110
|
+
Container.BindInstance(cache);
|
|
111
|
+
RecordingAssigner assigner = new();
|
|
112
|
+
Container.Bind<IRelationalComponentAssigner>().FromInstance(assigner);
|
|
113
|
+
Container.BindInstance(new RelationalSceneAssignmentOptions(false));
|
|
114
|
+
Container.BindInterfacesTo<RelationalComponentSceneInitializer>().AsSingle();
|
|
115
|
+
|
|
116
|
+
Scene scene = CreateTempScene("ZenjectTestScene_InactiveFalse");
|
|
117
|
+
ZenjectRelationalTester tester = CreateHierarchy();
|
|
118
|
+
tester.gameObject.SetActive(false);
|
|
119
|
+
GameObject root = tester.transform.root.gameObject;
|
|
120
|
+
SceneManager.MoveGameObjectToScene(root, scene);
|
|
121
|
+
yield return null;
|
|
122
|
+
|
|
123
|
+
IInitializable initializer = Container.Resolve<IInitializable>();
|
|
124
|
+
initializer.Initialize();
|
|
125
|
+
yield return null;
|
|
126
|
+
|
|
127
|
+
Assert.That(
|
|
128
|
+
assigner.CallCount,
|
|
129
|
+
Is.EqualTo(0),
|
|
130
|
+
"Initializer should skip inactive tester when IncludeInactive is false"
|
|
131
|
+
);
|
|
171
132
|
}
|
|
172
133
|
|
|
173
134
|
[UnityTest]
|
|
174
135
|
public System.Collections.IEnumerator SceneInitializerIncludesInactiveWhenOptionEnabled()
|
|
175
136
|
{
|
|
176
137
|
AttributeMetadataCache cache = CreateCacheFor(typeof(ZenjectRelationalTester));
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
)
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
138
|
+
Container.BindInstance(cache);
|
|
139
|
+
RecordingAssigner assigner = new();
|
|
140
|
+
Container.Bind<IRelationalComponentAssigner>().FromInstance(assigner);
|
|
141
|
+
Container.BindInstance(new RelationalSceneAssignmentOptions(true));
|
|
142
|
+
Container.BindInterfacesTo<RelationalComponentSceneInitializer>().AsSingle();
|
|
143
|
+
|
|
144
|
+
Scene scene = CreateTempScene("ZenjectTestScene_InactiveTrue");
|
|
145
|
+
ZenjectRelationalTester tester = CreateHierarchy();
|
|
146
|
+
tester.gameObject.SetActive(false);
|
|
147
|
+
GameObject root = tester.transform.root.gameObject;
|
|
148
|
+
SceneManager.MoveGameObjectToScene(root, scene);
|
|
149
|
+
yield return null;
|
|
150
|
+
|
|
151
|
+
IInitializable initializer = Container.Resolve<IInitializable>();
|
|
152
|
+
initializer.Initialize();
|
|
153
|
+
yield return null;
|
|
154
|
+
|
|
155
|
+
Assert.That(
|
|
156
|
+
assigner.CallCount,
|
|
157
|
+
Is.EqualTo(1),
|
|
158
|
+
"Initializer should include inactive tester when IncludeInactive is true"
|
|
159
|
+
);
|
|
160
|
+
Assert.That(
|
|
161
|
+
assigner.LastComponent,
|
|
162
|
+
Is.SameAs(tester),
|
|
163
|
+
"Initializer should target the inactive tester component"
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
[UnityTest]
|
|
168
|
+
public System.Collections.IEnumerator SceneInitializerUsesMultiPassWhenConfigured()
|
|
169
|
+
{
|
|
170
|
+
AttributeMetadataCache cache = CreateCacheFor(typeof(ZenjectRelationalTester));
|
|
171
|
+
Container.BindInstance(cache);
|
|
172
|
+
RecordingAssigner assigner = new();
|
|
173
|
+
Container.Bind<IRelationalComponentAssigner>().FromInstance(assigner);
|
|
174
|
+
Container.BindInstance(
|
|
175
|
+
new RelationalSceneAssignmentOptions(true, useSinglePassScan: false)
|
|
176
|
+
);
|
|
177
|
+
Container.BindInterfacesTo<RelationalComponentSceneInitializer>().AsSingle();
|
|
178
|
+
|
|
179
|
+
Scene scene = CreateTempScene("ZenjectMultiPassScene");
|
|
180
|
+
ZenjectRelationalTester tester = CreateHierarchy();
|
|
181
|
+
SceneManager.MoveGameObjectToScene(tester.transform.root.gameObject, scene);
|
|
182
|
+
yield return null;
|
|
183
|
+
|
|
184
|
+
IInitializable initializer = Container.Resolve<IInitializable>();
|
|
185
|
+
initializer.Initialize();
|
|
186
|
+
yield return null;
|
|
187
|
+
|
|
188
|
+
Assert.That(
|
|
189
|
+
assigner.CallCount,
|
|
190
|
+
Is.EqualTo(1),
|
|
191
|
+
"Multi-pass configuration should assign each relational component once"
|
|
192
|
+
);
|
|
193
|
+
Assert.That(
|
|
194
|
+
assigner.LastComponent,
|
|
195
|
+
Is.SameAs(tester),
|
|
196
|
+
"Multi-pass configuration should target the tester in the active scene"
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
[UnityTest]
|
|
201
|
+
public System.Collections.IEnumerator SceneLoadListenerAssignsAdditiveSceneSinglePass()
|
|
202
|
+
{
|
|
203
|
+
AttributeMetadataCache cache = CreateCacheFor(typeof(ZenjectRelationalTester));
|
|
204
|
+
RelationalComponentAssigner assigner = new(cache);
|
|
205
|
+
RelationalSceneAssignmentOptions options = new(
|
|
206
|
+
includeInactive: true,
|
|
207
|
+
useSinglePassScan: true
|
|
208
|
+
);
|
|
209
|
+
RelationalSceneLoadListener listener = new(assigner, cache, options);
|
|
210
|
+
listener.Initialize();
|
|
211
|
+
TrackDisposable(listener);
|
|
212
|
+
|
|
213
|
+
Scene additive = CreateTempScene("Zenject_Additive_Runtime_Single", setActive: false);
|
|
214
|
+
|
|
215
|
+
ZenjectRelationalTester tester = CreateHierarchy();
|
|
216
|
+
GameObject root = tester.transform.root.gameObject;
|
|
217
|
+
SceneManager.MoveGameObjectToScene(root, additive);
|
|
218
|
+
|
|
219
|
+
yield return null;
|
|
220
|
+
|
|
221
|
+
listener.OnSceneLoaded(additive, LoadSceneMode.Additive);
|
|
222
|
+
yield return null;
|
|
223
|
+
|
|
224
|
+
Assert.IsTrue(
|
|
225
|
+
tester.parentBody != null,
|
|
226
|
+
"Scene load listener should assign parentBody in single-pass mode"
|
|
227
|
+
);
|
|
228
|
+
Assert.IsTrue(
|
|
229
|
+
tester.childCollider != null,
|
|
230
|
+
"Scene load listener should assign childCollider in single-pass mode"
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
[UnityTest]
|
|
235
|
+
public System.Collections.IEnumerator SceneLoadListenerAssignsAdditiveSceneMultiPass()
|
|
236
|
+
{
|
|
237
|
+
AttributeMetadataCache cache = CreateCacheFor(typeof(ZenjectRelationalTester));
|
|
238
|
+
RelationalComponentAssigner assigner = new(cache);
|
|
239
|
+
RelationalSceneAssignmentOptions options = new(
|
|
240
|
+
includeInactive: true,
|
|
241
|
+
useSinglePassScan: false
|
|
242
|
+
);
|
|
243
|
+
RelationalSceneLoadListener listener = new(assigner, cache, options);
|
|
244
|
+
listener.Initialize();
|
|
245
|
+
TrackDisposable(listener);
|
|
246
|
+
|
|
247
|
+
Scene additive = CreateTempScene("Zenject_Additive_Runtime_Multi", setActive: false);
|
|
248
|
+
|
|
249
|
+
ZenjectRelationalTester tester = CreateHierarchy();
|
|
250
|
+
GameObject root = tester.transform.root.gameObject;
|
|
251
|
+
SceneManager.MoveGameObjectToScene(root, additive);
|
|
252
|
+
|
|
253
|
+
yield return null;
|
|
254
|
+
|
|
255
|
+
listener.OnSceneLoaded(additive, LoadSceneMode.Additive);
|
|
256
|
+
yield return null;
|
|
257
|
+
|
|
258
|
+
Assert.IsTrue(
|
|
259
|
+
tester.parentBody != null,
|
|
260
|
+
"Scene load listener should assign parentBody in multi-pass mode"
|
|
261
|
+
);
|
|
262
|
+
Assert.IsTrue(
|
|
263
|
+
tester.childCollider != null,
|
|
264
|
+
"Scene load listener should assign childCollider in multi-pass mode"
|
|
265
|
+
);
|
|
215
266
|
}
|
|
216
267
|
|
|
217
268
|
[Test]
|
|
@@ -219,14 +270,12 @@ namespace WallstopStudios.UnityHelpers.Tests.Integrations.Zenject
|
|
|
219
270
|
{
|
|
220
271
|
ZenjectRelationalTester tester = CreateHierarchy();
|
|
221
272
|
Container.AssignRelationalHierarchy(tester.gameObject, includeInactiveChildren: false);
|
|
222
|
-
Assert.
|
|
223
|
-
tester.parentBody,
|
|
224
|
-
Is.Not.Null,
|
|
273
|
+
Assert.IsTrue(
|
|
274
|
+
tester.parentBody != null,
|
|
225
275
|
"AssignRelationalHierarchy should assign parentBody"
|
|
226
276
|
);
|
|
227
|
-
Assert.
|
|
228
|
-
tester.childCollider,
|
|
229
|
-
Is.Not.Null,
|
|
277
|
+
Assert.IsTrue(
|
|
278
|
+
tester.childCollider != null,
|
|
230
279
|
"AssignRelationalHierarchy should assign childCollider"
|
|
231
280
|
);
|
|
232
281
|
}
|
|
@@ -235,46 +284,35 @@ namespace WallstopStudios.UnityHelpers.Tests.Integrations.Zenject
|
|
|
235
284
|
public System.Collections.IEnumerator SceneInitializerIgnoresNonActiveScenes()
|
|
236
285
|
{
|
|
237
286
|
AttributeMetadataCache cache = CreateCacheFor(typeof(ZenjectRelationalTester));
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
)
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
Is.SameAs(testerA),
|
|
268
|
-
"Active scene tester should be assigned"
|
|
269
|
-
);
|
|
270
|
-
}
|
|
271
|
-
finally
|
|
272
|
-
{
|
|
273
|
-
if (cache != null)
|
|
274
|
-
{
|
|
275
|
-
UnityEngine.Object.DestroyImmediate(cache);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
287
|
+
RecordingAssigner assigner = new();
|
|
288
|
+
Container.BindInstance(cache);
|
|
289
|
+
Container.Bind<IRelationalComponentAssigner>().FromInstance(assigner);
|
|
290
|
+
Container.BindInstance(new RelationalSceneAssignmentOptions(true));
|
|
291
|
+
Container.BindInterfacesTo<RelationalComponentSceneInitializer>().AsSingle();
|
|
292
|
+
|
|
293
|
+
Scene active = CreateTempScene("ZenjectActiveScene_Sep");
|
|
294
|
+
ZenjectRelationalTester testerA = CreateHierarchy();
|
|
295
|
+
SceneManager.MoveGameObjectToScene(testerA.transform.root.gameObject, active);
|
|
296
|
+
|
|
297
|
+
Scene secondary = CreateTempScene("ZenjectSecondaryScene_Sep", setActive: false);
|
|
298
|
+
ZenjectRelationalTester testerB = CreateHierarchy();
|
|
299
|
+
SceneManager.MoveGameObjectToScene(testerB.transform.root.gameObject, secondary);
|
|
300
|
+
yield return null;
|
|
301
|
+
|
|
302
|
+
IInitializable initializer = Container.Resolve<IInitializable>();
|
|
303
|
+
initializer.Initialize();
|
|
304
|
+
yield return null;
|
|
305
|
+
|
|
306
|
+
Assert.That(
|
|
307
|
+
assigner.CallCount,
|
|
308
|
+
Is.EqualTo(1),
|
|
309
|
+
"Initializer should only process components from the active scene"
|
|
310
|
+
);
|
|
311
|
+
Assert.That(
|
|
312
|
+
assigner.LastComponent,
|
|
313
|
+
Is.SameAs(testerA),
|
|
314
|
+
"Active scene tester should be assigned"
|
|
315
|
+
);
|
|
278
316
|
}
|
|
279
317
|
|
|
280
318
|
[Test]
|
|
@@ -298,24 +336,20 @@ namespace WallstopStudios.UnityHelpers.Tests.Integrations.Zenject
|
|
|
298
336
|
rootTester.gameObject,
|
|
299
337
|
includeInactiveChildren: false
|
|
300
338
|
);
|
|
301
|
-
Assert.
|
|
302
|
-
rootTester.parentBody,
|
|
303
|
-
Is.Not.Null,
|
|
339
|
+
Assert.IsTrue(
|
|
340
|
+
rootTester.parentBody != null,
|
|
304
341
|
"Root tester should be assigned even when includeInactiveChildren is false"
|
|
305
342
|
);
|
|
306
|
-
Assert.
|
|
307
|
-
rootTester.childCollider,
|
|
308
|
-
Is.Not.Null,
|
|
343
|
+
Assert.IsTrue(
|
|
344
|
+
rootTester.childCollider != null,
|
|
309
345
|
"Root tester should be assigned even when includeInactiveChildren is false"
|
|
310
346
|
);
|
|
311
|
-
Assert.
|
|
312
|
-
subTester.parentBody,
|
|
313
|
-
Is.Null,
|
|
347
|
+
Assert.IsTrue(
|
|
348
|
+
subTester.parentBody == null,
|
|
314
349
|
"Inactive sub tester should be skipped when includeInactiveChildren is false"
|
|
315
350
|
);
|
|
316
|
-
Assert.
|
|
317
|
-
subTester.childCollider,
|
|
318
|
-
Is.Null,
|
|
351
|
+
Assert.IsTrue(
|
|
352
|
+
subTester.childCollider == null,
|
|
319
353
|
"Inactive sub tester should be skipped when includeInactiveChildren is false"
|
|
320
354
|
);
|
|
321
355
|
|
|
@@ -324,14 +358,12 @@ namespace WallstopStudios.UnityHelpers.Tests.Integrations.Zenject
|
|
|
324
358
|
rootTester.gameObject,
|
|
325
359
|
includeInactiveChildren: true
|
|
326
360
|
);
|
|
327
|
-
Assert.
|
|
328
|
-
subTester.parentBody,
|
|
329
|
-
Is.Not.Null,
|
|
361
|
+
Assert.IsTrue(
|
|
362
|
+
subTester.parentBody != null,
|
|
330
363
|
"Inactive sub tester should be assigned when includeInactiveChildren is true"
|
|
331
364
|
);
|
|
332
|
-
Assert.
|
|
333
|
-
subTester.childCollider,
|
|
334
|
-
Is.Not.Null,
|
|
365
|
+
Assert.IsTrue(
|
|
366
|
+
subTester.childCollider != null,
|
|
335
367
|
"Inactive sub tester should be assigned when includeInactiveChildren is true"
|
|
336
368
|
);
|
|
337
369
|
}
|
|
@@ -377,14 +409,12 @@ namespace WallstopStudios.UnityHelpers.Tests.Integrations.Zenject
|
|
|
377
409
|
Is.SameAs(instance),
|
|
378
410
|
"Instantiate should target the created tester instance"
|
|
379
411
|
);
|
|
380
|
-
Assert.
|
|
381
|
-
instance.parentBody,
|
|
382
|
-
Is.Not.Null,
|
|
412
|
+
Assert.IsTrue(
|
|
413
|
+
instance.parentBody != null,
|
|
383
414
|
"ParentComponent should be assigned from override parent"
|
|
384
415
|
);
|
|
385
|
-
Assert.
|
|
386
|
-
instance.childCollider,
|
|
387
|
-
Is.Not.Null,
|
|
416
|
+
Assert.IsTrue(
|
|
417
|
+
instance.childCollider != null,
|
|
388
418
|
"ChildComponent should be assigned from prefab child collider"
|
|
389
419
|
);
|
|
390
420
|
}
|
|
@@ -403,14 +433,12 @@ namespace WallstopStudios.UnityHelpers.Tests.Integrations.Zenject
|
|
|
403
433
|
);
|
|
404
434
|
Track(instance.gameObject);
|
|
405
435
|
|
|
406
|
-
Assert.
|
|
407
|
-
instance.parentBody,
|
|
408
|
-
Is.Not.Null,
|
|
436
|
+
Assert.IsTrue(
|
|
437
|
+
instance.parentBody != null,
|
|
409
438
|
"ParentComponent should be assigned from override parent without a bound assigner"
|
|
410
439
|
);
|
|
411
|
-
Assert.
|
|
412
|
-
instance.childCollider,
|
|
413
|
-
Is.Not.Null,
|
|
440
|
+
Assert.IsTrue(
|
|
441
|
+
instance.childCollider != null,
|
|
414
442
|
"ChildComponent should be assigned without a bound assigner"
|
|
415
443
|
);
|
|
416
444
|
}
|
|
@@ -429,14 +457,12 @@ namespace WallstopStudios.UnityHelpers.Tests.Integrations.Zenject
|
|
|
429
457
|
);
|
|
430
458
|
Track(instance.gameObject);
|
|
431
459
|
|
|
432
|
-
Assert.
|
|
433
|
-
instance.parentBody,
|
|
434
|
-
Is.Not.Null,
|
|
460
|
+
Assert.IsTrue(
|
|
461
|
+
instance.parentBody != null,
|
|
435
462
|
"ParentComponent should be assigned from override parent"
|
|
436
463
|
);
|
|
437
|
-
Assert.
|
|
438
|
-
instance.childCollider,
|
|
439
|
-
Is.Not.Null,
|
|
464
|
+
Assert.IsTrue(
|
|
465
|
+
instance.childCollider != null,
|
|
440
466
|
"ChildComponent should be assigned from prefab child collider"
|
|
441
467
|
);
|
|
442
468
|
}
|
|
@@ -485,27 +511,22 @@ namespace WallstopStudios.UnityHelpers.Tests.Integrations.Zenject
|
|
|
485
511
|
return tester;
|
|
486
512
|
}
|
|
487
513
|
|
|
488
|
-
private
|
|
514
|
+
private AttributeMetadataCache CreateCacheFor(Type componentType)
|
|
489
515
|
{
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
private static AttributeMetadataCache CreateCacheFor(Type componentType)
|
|
495
|
-
{
|
|
496
|
-
AttributeMetadataCache cache =
|
|
497
|
-
ScriptableObject.CreateInstance<AttributeMetadataCache>();
|
|
516
|
+
AttributeMetadataCache cache = Track(
|
|
517
|
+
ScriptableObject.CreateInstance<AttributeMetadataCache>()
|
|
518
|
+
);
|
|
498
519
|
|
|
499
520
|
AttributeMetadataCache.RelationalFieldMetadata[] fields =
|
|
500
521
|
{
|
|
501
|
-
new
|
|
522
|
+
new(
|
|
502
523
|
nameof(ZenjectRelationalTester.parentBody),
|
|
503
524
|
AttributeMetadataCache.RelationalAttributeKind.Parent,
|
|
504
525
|
AttributeMetadataCache.FieldKind.Single,
|
|
505
526
|
typeof(Rigidbody).AssemblyQualifiedName,
|
|
506
527
|
isInterface: false
|
|
507
528
|
),
|
|
508
|
-
new
|
|
529
|
+
new(
|
|
509
530
|
nameof(ZenjectRelationalTester.childCollider),
|
|
510
531
|
AttributeMetadataCache.RelationalAttributeKind.Child,
|
|
511
532
|
AttributeMetadataCache.FieldKind.Single,
|
|
@@ -516,10 +537,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Integrations.Zenject
|
|
|
516
537
|
|
|
517
538
|
AttributeMetadataCache.RelationalTypeMetadata[] relationalTypes =
|
|
518
539
|
{
|
|
519
|
-
new
|
|
520
|
-
componentType.AssemblyQualifiedName,
|
|
521
|
-
fields
|
|
522
|
-
),
|
|
540
|
+
new(componentType.AssemblyQualifiedName, fields),
|
|
523
541
|
};
|
|
524
542
|
|
|
525
543
|
cache._relationalTypeMetadata = relationalTypes;
|
|
@@ -294,7 +294,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Performance
|
|
|
294
294
|
BenchmarkReadmeUpdater.UpdateSection(
|
|
295
295
|
"SPATIAL_TREE_BENCHMARKS",
|
|
296
296
|
finalReadmeLines,
|
|
297
|
-
"SPATIAL_TREE_2D_PERFORMANCE.md"
|
|
297
|
+
"Docs/SPATIAL_TREE_2D_PERFORMANCE.md"
|
|
298
298
|
);
|
|
299
299
|
|
|
300
300
|
yield break;
|
|
@@ -428,6 +428,11 @@ namespace WallstopStudios.UnityHelpers.Tests.Performance
|
|
|
428
428
|
return lines;
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
+
// Add an intermediate heading so tab headers (####) increment correctly from h3.
|
|
432
|
+
lines.Add("### Datasets");
|
|
433
|
+
|
|
434
|
+
lines.Add(string.Empty);
|
|
435
|
+
|
|
431
436
|
lines.Add("<!-- tabs:start -->");
|
|
432
437
|
|
|
433
438
|
lines.Add(string.Empty);
|