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
|
@@ -35,7 +35,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
35
35
|
AssetDatabase.Refresh();
|
|
36
36
|
|
|
37
37
|
TextureImporter imp = AssetImporter.GetAtPath(path) as TextureImporter;
|
|
38
|
-
Assert.
|
|
38
|
+
Assert.IsTrue(imp != null);
|
|
39
39
|
imp.textureType = TextureImporterType.Sprite;
|
|
40
40
|
imp.spriteImportMode = SpriteImportMode.Single;
|
|
41
41
|
imp.isReadable = true;
|
|
@@ -45,9 +45,9 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
45
45
|
SpritePivotAdjuster window = Track(
|
|
46
46
|
ScriptableObject.CreateInstance<SpritePivotAdjuster>()
|
|
47
47
|
);
|
|
48
|
-
window._directoryPaths = new System.Collections.Generic.List<
|
|
48
|
+
window._directoryPaths = new System.Collections.Generic.List<Object>
|
|
49
49
|
{
|
|
50
|
-
AssetDatabase.LoadAssetAtPath<
|
|
50
|
+
AssetDatabase.LoadAssetAtPath<Object>(Root),
|
|
51
51
|
};
|
|
52
52
|
window._alphaCutoff = 0.01f;
|
|
53
53
|
window._skipUnchanged = false;
|
|
@@ -23,6 +23,24 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
23
23
|
bool hasIOS = System.Array.IndexOf(names, "iOS") >= 0;
|
|
24
24
|
Assert.IsTrue(hasIPhone || hasIOS);
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
[Test]
|
|
28
|
+
public void CachesResultsAndIsSorted()
|
|
29
|
+
{
|
|
30
|
+
string[] a = TexturePlatformNameHelper.GetKnownPlatformNames();
|
|
31
|
+
string[] b = TexturePlatformNameHelper.GetKnownPlatformNames();
|
|
32
|
+
// Expect the exact same reference due to caching
|
|
33
|
+
Assert.AreSame(a, b);
|
|
34
|
+
|
|
35
|
+
// Verify ascending ordinal order
|
|
36
|
+
for (int i = 1; i < a.Length; i++)
|
|
37
|
+
{
|
|
38
|
+
Assert.LessOrEqual(
|
|
39
|
+
string.Compare(a[i - 1], a[i], System.StringComparison.Ordinal),
|
|
40
|
+
0
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
26
44
|
}
|
|
27
45
|
#endif
|
|
28
46
|
}
|
|
@@ -51,7 +51,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
51
51
|
|
|
52
52
|
AssetDatabase.Refresh();
|
|
53
53
|
Texture2D tex = AssetDatabase.LoadAssetAtPath<Texture2D>(path);
|
|
54
|
-
Assert.
|
|
54
|
+
Assert.IsTrue(tex != null, "Texture should exist after resize");
|
|
55
55
|
Assert.That(tex.width, Is.EqualTo(32), "Width should double");
|
|
56
56
|
Assert.That(tex.height, Is.EqualTo(20), "Height should double");
|
|
57
57
|
}
|
|
@@ -125,7 +125,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
125
125
|
wizard.heightMultiplier = 1f;
|
|
126
126
|
wizard.scalingResizeAlgorithm = TextureResizerWizard.ResizeAlgorithm.Point;
|
|
127
127
|
DefaultAsset outAsset = AssetDatabase.LoadAssetAtPath<DefaultAsset>(OutRoot);
|
|
128
|
-
Assert.
|
|
128
|
+
Assert.IsTrue(outAsset != null, "Output folder asset missing");
|
|
129
129
|
wizard.outputFolder = outAsset;
|
|
130
130
|
wizard.OnWizardCreate();
|
|
131
131
|
|
|
@@ -136,7 +136,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
136
136
|
|
|
137
137
|
string outPath = Path.Combine(OutRoot, "out.png").Replace('\\', '/');
|
|
138
138
|
Texture2D outTex = AssetDatabase.LoadAssetAtPath<Texture2D>(outPath);
|
|
139
|
-
Assert.
|
|
139
|
+
Assert.IsTrue(outTex != null, "Expected resized texture in output folder");
|
|
140
140
|
Assert.That(outTex.width, Is.EqualTo(16));
|
|
141
141
|
Assert.That(outTex.height, Is.EqualTo(8));
|
|
142
142
|
}
|
|
@@ -176,7 +176,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
176
176
|
AssetDatabase.Refresh();
|
|
177
177
|
|
|
178
178
|
TextureImporter importer = AssetImporter.GetAtPath(path) as TextureImporter;
|
|
179
|
-
Assert.
|
|
179
|
+
Assert.IsTrue(importer != null);
|
|
180
180
|
importer.isReadable = false;
|
|
181
181
|
importer.SaveAndReimport();
|
|
182
182
|
|
|
@@ -196,7 +196,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
196
196
|
|
|
197
197
|
AssetDatabase.Refresh();
|
|
198
198
|
importer = AssetImporter.GetAtPath(path) as TextureImporter;
|
|
199
|
-
Assert.
|
|
199
|
+
Assert.IsTrue(importer != null);
|
|
200
200
|
Assert.IsFalse(importer.isReadable, "Importer readability should be restored");
|
|
201
201
|
}
|
|
202
202
|
|
|
@@ -55,7 +55,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
55
55
|
out TextureImporter importer
|
|
56
56
|
);
|
|
57
57
|
Assert.IsTrue(changed, "Expected API to apply changes");
|
|
58
|
-
Assert.
|
|
58
|
+
Assert.IsTrue(importer != null);
|
|
59
59
|
importer.SaveAndReimport();
|
|
60
60
|
|
|
61
61
|
TextureImporterPlatformSettings ps = importer.GetDefaultPlatformTextureSettings();
|
|
@@ -88,7 +88,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
88
88
|
out TextureImporter importer
|
|
89
89
|
);
|
|
90
90
|
Assert.IsTrue(changed, "Expected override to apply");
|
|
91
|
-
Assert.
|
|
91
|
+
Assert.IsTrue(importer != null);
|
|
92
92
|
importer.SaveAndReimport();
|
|
93
93
|
|
|
94
94
|
TextureImporterPlatformSettings ops = importer.GetPlatformTextureSettings("Standalone");
|
|
@@ -120,7 +120,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
120
120
|
out TextureImporter importer
|
|
121
121
|
);
|
|
122
122
|
Assert.IsTrue(changed, "Expected override to apply even for unknown platform name");
|
|
123
|
-
Assert.
|
|
123
|
+
Assert.IsTrue(importer != null);
|
|
124
124
|
importer.SaveAndReimport();
|
|
125
125
|
|
|
126
126
|
TextureImporterPlatformSettings ops = importer.GetPlatformTextureSettings(
|
|
@@ -75,8 +75,8 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
75
75
|
|
|
76
76
|
impIncluded = AssetImporter.GetAtPath(included) as TextureImporter;
|
|
77
77
|
impOther = AssetImporter.GetAtPath(other) as TextureImporter;
|
|
78
|
-
Assert.
|
|
79
|
-
Assert.
|
|
78
|
+
Assert.IsTrue(impIncluded != null);
|
|
79
|
+
Assert.IsTrue(impOther != null);
|
|
80
80
|
|
|
81
81
|
Assert.That(impIncluded.isReadable, Is.False);
|
|
82
82
|
Assert.That(impIncluded.wrapMode, Is.EqualTo(TextureWrapMode.Clamp));
|
|
@@ -187,7 +187,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
187
187
|
AssetDatabase.Refresh();
|
|
188
188
|
|
|
189
189
|
TextureImporter imp = AssetImporter.GetAtPath(path) as TextureImporter;
|
|
190
|
-
Assert.
|
|
190
|
+
Assert.IsTrue(imp != null);
|
|
191
191
|
TextureImporterPlatformSettings ops = imp.GetPlatformTextureSettings("Standalone");
|
|
192
192
|
Assert.IsTrue(ops.overridden);
|
|
193
193
|
Assert.AreEqual(256, ops.maxTextureSize);
|
|
@@ -203,7 +203,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
203
203
|
|
|
204
204
|
// Set importer to desired state first
|
|
205
205
|
TextureImporter imp = AssetImporter.GetAtPath(path) as TextureImporter;
|
|
206
|
-
Assert.
|
|
206
|
+
Assert.IsTrue(imp != null);
|
|
207
207
|
imp.wrapMode = TextureWrapMode.Clamp;
|
|
208
208
|
imp.filterMode = FilterMode.Bilinear;
|
|
209
209
|
TextureImporterPlatformSettings ps = imp.GetDefaultPlatformTextureSettings();
|
|
@@ -48,9 +48,9 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
// Set directories list
|
|
51
|
-
window.directories = new System.Collections.Generic.List<
|
|
51
|
+
window.directories = new System.Collections.Generic.List<Object>
|
|
52
52
|
{
|
|
53
|
-
AssetDatabase.LoadAssetAtPath<
|
|
53
|
+
AssetDatabase.LoadAssetAtPath<Object>(Root),
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
// Configure changes
|
|
@@ -69,8 +69,8 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Sprites
|
|
|
69
69
|
AssetDatabase.Refresh();
|
|
70
70
|
TextureImporter impA = AssetImporter.GetAtPath(a) as TextureImporter;
|
|
71
71
|
TextureImporter impB = AssetImporter.GetAtPath(b) as TextureImporter;
|
|
72
|
-
Assert.
|
|
73
|
-
Assert.
|
|
72
|
+
Assert.IsTrue(impA != null);
|
|
73
|
+
Assert.IsTrue(impB != null);
|
|
74
74
|
|
|
75
75
|
// Verify a subset of settings applied
|
|
76
76
|
Assert.That(impA.isReadable, Is.False); // isReadOnly=true → not readable
|
|
@@ -1,134 +1,46 @@
|
|
|
1
1
|
namespace WallstopStudios.UnityHelpers.Tests.Editor.Tools
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
|
-
using System.Collections.Generic;
|
|
5
|
-
using System.IO;
|
|
6
|
-
using System.Linq;
|
|
7
4
|
using NUnit.Framework;
|
|
8
|
-
using UnityEditor;
|
|
9
5
|
using UnityEngine;
|
|
10
|
-
using
|
|
6
|
+
using WallstopStudios.UnityHelpers.Editor.Tools;
|
|
11
7
|
|
|
12
8
|
public sealed class ImageBlurToolTests
|
|
13
9
|
{
|
|
14
|
-
private const string TempRoot = "Assets/Temp/ImageBlurToolTests";
|
|
15
|
-
|
|
16
|
-
[SetUp]
|
|
17
|
-
public void SetUp()
|
|
18
|
-
{
|
|
19
|
-
EnsureFolder(TempRoot);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
[TearDown]
|
|
23
|
-
public void TearDown()
|
|
24
|
-
{
|
|
25
|
-
AssetDatabase.DeleteAsset("Assets/Temp");
|
|
26
|
-
AssetDatabase.Refresh();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
10
|
[Test]
|
|
30
|
-
public void
|
|
11
|
+
public void KernelHasExpectedLengthAndNormalizes()
|
|
31
12
|
{
|
|
32
|
-
|
|
33
|
-
Assert.IsNotNull(k, "Kernel should not be null");
|
|
34
|
-
Assert.That(k.Length, Is.EqualTo(11), "Kernel size should be 2r+1");
|
|
35
|
-
|
|
36
|
-
float sum = k.Sum();
|
|
37
|
-
Assert.That(Mathf.Abs(1f - sum) < 1e-3f, "Kernel should sum to 1");
|
|
38
|
-
|
|
39
|
-
for (int i = 0; i < k.Length; i++)
|
|
13
|
+
for (int radius = 1; radius <= 4; radius++)
|
|
40
14
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
15
|
+
float[] kernel = ImageBlurTool.KernelForTests(radius);
|
|
16
|
+
Assert.NotNull(kernel);
|
|
17
|
+
Assert.AreEqual(radius * 2 + 1, kernel.Length);
|
|
18
|
+
float sum = 0f;
|
|
19
|
+
for (int i = 0; i < kernel.Length; i++)
|
|
20
|
+
{
|
|
21
|
+
sum += kernel[i];
|
|
22
|
+
}
|
|
23
|
+
Assert.That(sum, Is.InRange(0.999f, 1.001f));
|
|
45
24
|
}
|
|
46
25
|
}
|
|
47
26
|
|
|
48
27
|
[Test]
|
|
49
|
-
public void
|
|
28
|
+
public void BlurredTextureMatchesInputDimensions()
|
|
50
29
|
{
|
|
51
|
-
Texture2D
|
|
52
|
-
|
|
53
|
-
pixels[12] = Color.white;
|
|
54
|
-
src.SetPixels(pixels);
|
|
55
|
-
src.Apply();
|
|
56
|
-
|
|
57
|
-
Texture2D blurred =
|
|
58
|
-
WallstopStudios.UnityHelpers.Editor.Tools.ImageBlurTool.BlurredForTests(src, 2);
|
|
59
|
-
Assert.IsNotNull(blurred, "Blurred texture should be created");
|
|
60
|
-
Assert.That(blurred.width, Is.EqualTo(5));
|
|
61
|
-
Assert.That(blurred.height, Is.EqualTo(5));
|
|
62
|
-
|
|
63
|
-
Color[] outPix = blurred.GetPixels();
|
|
64
|
-
Assert.That(outPix[12].maxColorComponent < 1f, "Center intensity should reduce");
|
|
65
|
-
Assert.That(outPix[11].maxColorComponent > 0f, "Neighbor should gain intensity");
|
|
66
|
-
Assert.That(outPix[13].maxColorComponent > 0f, "Neighbor should gain intensity");
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
[Test]
|
|
70
|
-
public void TrySyncDirectoryCollectsTextureAssets()
|
|
71
|
-
{
|
|
72
|
-
string texPath = Path.Combine(TempRoot, "tex.png").Replace('\\', '/');
|
|
73
|
-
CreatePng(texPath, 8, 8, Color.red);
|
|
74
|
-
|
|
75
|
-
AssetDatabase.Refresh();
|
|
76
|
-
Object folderObj = AssetDatabase.LoadAssetAtPath<Object>(TempRoot);
|
|
77
|
-
Assert.IsNotNull(folderObj, "Temp folder not found as asset");
|
|
78
|
-
|
|
79
|
-
List<Texture2D> list = new();
|
|
80
|
-
WallstopStudios.UnityHelpers.Editor.Tools.ImageBlurTool.TrySyncDirectory(
|
|
81
|
-
TempRoot,
|
|
82
|
-
list
|
|
83
|
-
);
|
|
84
|
-
Assert.That(
|
|
85
|
-
list.Count,
|
|
86
|
-
Is.GreaterThanOrEqualTo(1),
|
|
87
|
-
"Expected at least one texture collected"
|
|
88
|
-
);
|
|
89
|
-
Assert.IsTrue(
|
|
90
|
-
list.Any(t => t != null && t.name == "tex"),
|
|
91
|
-
"Texture tex should be present"
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
private static void EnsureFolder(string relPath)
|
|
96
|
-
{
|
|
97
|
-
string[] parts = relPath.Split('/');
|
|
98
|
-
string cur = parts[0];
|
|
99
|
-
for (int i = 1; i < parts.Length; i++)
|
|
30
|
+
Texture2D tex = new(8, 8, TextureFormat.RGBA32, false);
|
|
31
|
+
for (int y = 0; y < tex.height; y++)
|
|
100
32
|
{
|
|
101
|
-
|
|
102
|
-
if (!AssetDatabase.IsValidFolder(next))
|
|
33
|
+
for (int x = 0; x < tex.width; x++)
|
|
103
34
|
{
|
|
104
|
-
|
|
35
|
+
tex.SetPixel(x, y, Color.white);
|
|
105
36
|
}
|
|
106
|
-
cur = next;
|
|
107
37
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
private static void CreatePng(string relPath, int w, int h, Color c)
|
|
111
|
-
{
|
|
112
|
-
string dir = Path.GetDirectoryName(relPath).Replace('\\', '/');
|
|
113
|
-
EnsureFolder(dir);
|
|
114
|
-
Texture2D t = new(w, h, TextureFormat.RGBA32, false);
|
|
115
|
-
Color[] pix = Enumerable.Repeat(c, w * h).ToArray();
|
|
116
|
-
t.SetPixels(pix);
|
|
117
|
-
t.Apply();
|
|
118
|
-
byte[] data = t.EncodeToPNG();
|
|
119
|
-
File.WriteAllBytes(RelToFull(relPath), data);
|
|
120
|
-
}
|
|
38
|
+
tex.Apply();
|
|
121
39
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
0,
|
|
127
|
-
Application.dataPath.Length - "Assets".Length
|
|
128
|
-
),
|
|
129
|
-
rel
|
|
130
|
-
)
|
|
131
|
-
.Replace('\\', '/');
|
|
40
|
+
Texture2D blurred = ImageBlurTool.BlurredForTests(tex, 2);
|
|
41
|
+
Assert.IsTrue(blurred != null);
|
|
42
|
+
Assert.AreEqual(tex.width, blurred.width);
|
|
43
|
+
Assert.AreEqual(tex.height, blurred.height);
|
|
132
44
|
}
|
|
133
45
|
}
|
|
134
46
|
#endif
|
|
@@ -3,6 +3,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Utils
|
|
|
3
3
|
using System;
|
|
4
4
|
using System.Collections;
|
|
5
5
|
using System.Collections.Generic;
|
|
6
|
+
using System.Reflection;
|
|
6
7
|
using NUnit.Framework;
|
|
7
8
|
using UnityEngine;
|
|
8
9
|
using UnityEngine.SceneManagement;
|
|
@@ -19,6 +20,22 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Utils
|
|
|
19
20
|
/// </summary>
|
|
20
21
|
public abstract class CommonTestBase
|
|
21
22
|
{
|
|
23
|
+
[SetUp]
|
|
24
|
+
public virtual void BaseSetUp()
|
|
25
|
+
{
|
|
26
|
+
#if REFLEX_PRESENT
|
|
27
|
+
Type supportType = Type.GetType(
|
|
28
|
+
"WallstopStudios.UnityHelpers.Tests.TestUtils.ReflexTestSupport, WallstopStudios.UnityHelpers.Tests.Runtime",
|
|
29
|
+
throwOnError: false
|
|
30
|
+
);
|
|
31
|
+
MethodInfo ensureMethod = supportType?.GetMethod(
|
|
32
|
+
"EnsureReflexSettings",
|
|
33
|
+
BindingFlags.Public | BindingFlags.Static
|
|
34
|
+
);
|
|
35
|
+
ensureMethod?.Invoke(null, null);
|
|
36
|
+
#endif
|
|
37
|
+
}
|
|
38
|
+
|
|
22
39
|
protected readonly List<Object> _trackedObjects = new();
|
|
23
40
|
protected readonly List<IDisposable> _trackedDisposables = new();
|
|
24
41
|
protected readonly List<Scene> _trackedScenes = new();
|
|
@@ -40,7 +57,6 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Utils
|
|
|
40
57
|
#if UNITY_EDITOR
|
|
41
58
|
if (!Application.isPlaying)
|
|
42
59
|
{
|
|
43
|
-
// In EditMode tests, use EditorSceneManager as CreateScene is play-mode only
|
|
44
60
|
scene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single);
|
|
45
61
|
}
|
|
46
62
|
else
|
|
@@ -55,6 +71,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Utils
|
|
|
55
71
|
{
|
|
56
72
|
SceneManager.SetActiveScene(scene);
|
|
57
73
|
}
|
|
74
|
+
|
|
58
75
|
_trackedScenes.Add(scene);
|
|
59
76
|
return scene;
|
|
60
77
|
}
|
|
@@ -102,6 +119,27 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Utils
|
|
|
102
119
|
{
|
|
103
120
|
try
|
|
104
121
|
{
|
|
122
|
+
if (SceneManager.GetActiveScene() == scene)
|
|
123
|
+
{
|
|
124
|
+
int count = SceneManager.sceneCount;
|
|
125
|
+
for (int j = 0; j < count; j++)
|
|
126
|
+
{
|
|
127
|
+
Scene candidate = SceneManager.GetSceneAt(j);
|
|
128
|
+
if (
|
|
129
|
+
candidate.IsValid()
|
|
130
|
+
&& candidate.isLoaded
|
|
131
|
+
&& candidate != scene
|
|
132
|
+
)
|
|
133
|
+
{
|
|
134
|
+
SceneManager.SetActiveScene(candidate);
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (SceneManager.sceneCount == 1)
|
|
139
|
+
{
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
105
143
|
EditorSceneManager.CloseScene(scene, true);
|
|
106
144
|
}
|
|
107
145
|
catch { }
|
|
@@ -170,6 +208,27 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Utils
|
|
|
170
208
|
{
|
|
171
209
|
try
|
|
172
210
|
{
|
|
211
|
+
if (SceneManager.GetActiveScene() == scene)
|
|
212
|
+
{
|
|
213
|
+
int count = SceneManager.sceneCount;
|
|
214
|
+
for (int j = 0; j < count; j++)
|
|
215
|
+
{
|
|
216
|
+
Scene candidate = SceneManager.GetSceneAt(j);
|
|
217
|
+
if (
|
|
218
|
+
candidate.IsValid()
|
|
219
|
+
&& candidate.isLoaded
|
|
220
|
+
&& candidate != scene
|
|
221
|
+
)
|
|
222
|
+
{
|
|
223
|
+
SceneManager.SetActiveScene(candidate);
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
if (SceneManager.sceneCount == 1)
|
|
228
|
+
{
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
173
232
|
EditorSceneManager.CloseScene(scene, true);
|
|
174
233
|
}
|
|
175
234
|
catch { }
|
|
@@ -67,7 +67,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Utils
|
|
|
67
67
|
// Assert: no duplicate folder created and asset placed in reused folder
|
|
68
68
|
Assert.IsTrue(AssetDatabase.IsValidFolder("Assets/Resources/cASEtest"));
|
|
69
69
|
Assert.IsFalse(AssetDatabase.IsValidFolder("Assets/Resources/CaseTest 1"));
|
|
70
|
-
Assert.
|
|
70
|
+
Assert.IsTrue(AssetDatabase.LoadAssetAtPath<Object>(assetPath) != null);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
[UnityTest]
|
|
@@ -79,7 +79,7 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Utils
|
|
|
79
79
|
string occupiedPath = targetFolder + "/Duplicate.asset";
|
|
80
80
|
if (AssetDatabase.LoadAssetAtPath<Object>(occupiedPath) == null)
|
|
81
81
|
{
|
|
82
|
-
TextAsset ta = new
|
|
82
|
+
TextAsset ta = new("occupied");
|
|
83
83
|
AssetDatabase.CreateAsset(ta, occupiedPath);
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -89,8 +89,8 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Utils
|
|
|
89
89
|
yield return null;
|
|
90
90
|
|
|
91
91
|
// Assert: no duplicate asset created alongside
|
|
92
|
-
Assert.
|
|
93
|
-
AssetDatabase.LoadAssetAtPath<Object>(targetFolder + "/Duplicate 1.asset")
|
|
92
|
+
Assert.IsTrue(
|
|
93
|
+
AssetDatabase.LoadAssetAtPath<Object>(targetFolder + "/Duplicate 1.asset") == null
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -106,10 +106,10 @@ namespace WallstopStudios.UnityHelpers.Tests.Editor.Utils
|
|
|
106
106
|
yield return null;
|
|
107
107
|
|
|
108
108
|
// Assert: no asset created at the ambiguous path
|
|
109
|
-
Assert.
|
|
109
|
+
Assert.IsTrue(
|
|
110
110
|
AssetDatabase.LoadAssetAtPath<Object>(
|
|
111
111
|
"Assets/Resources/CreatorTests/Collision/NameCollision.asset"
|
|
112
|
-
)
|
|
112
|
+
) == null
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
|