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.
Files changed (264) hide show
  1. package/.editorconfig +1 -1
  2. package/.gitattributes +1 -1
  3. package/.githooks/pre-commit +31 -5
  4. package/.githooks/pre-push +50 -0
  5. package/.github/dependabot.yml +24 -2
  6. package/.github/scripts/check-markdown-links.ps1 +77 -0
  7. package/.github/scripts/check_markdown_links.py +89 -0
  8. package/.github/scripts/check_markdown_url_encoding.py +74 -0
  9. package/.github/scripts/validate_markdown_links.py +194 -0
  10. package/.github/workflows/csharpier-autofix.yml +152 -0
  11. package/.github/workflows/format-on-demand.yml +305 -0
  12. package/.github/workflows/lint-doc-links.yml +8 -5
  13. package/.github/workflows/markdown-json.yml +6 -2
  14. package/.github/workflows/npm-publish.yml +1 -1
  15. package/.github/workflows/prettier-autofix.yml +195 -0
  16. package/.github/workflows/update-dotnet-tools.yml +80 -0
  17. package/.github/workflows/yaml-format-lint.yml +41 -0
  18. package/.lychee.toml +4 -4
  19. package/.markdownlint.jsonc +21 -0
  20. package/.pre-commit-config.yaml +11 -3
  21. package/.yamllint.yaml +31 -0
  22. package/AGENTS.md +5 -1
  23. package/Docs/CHANGELOG.md +11 -0
  24. package/Docs/CONTRIBUTING.md +49 -0
  25. package/Docs/CONTRIBUTING.md.meta +7 -0
  26. package/{EDITOR_TOOLS_GUIDE.md → Docs/EDITOR_TOOLS_GUIDE.md} +4 -0
  27. package/Docs/EFFECTS_SYSTEM.md +1316 -0
  28. package/{EFFECTS_SYSTEM_TUTORIAL.md → Docs/EFFECTS_SYSTEM_TUTORIAL.md} +1 -1
  29. package/{GETTING_STARTED.md → Docs/GETTING_STARTED.md} +50 -64
  30. package/{GLOSSARY.md → Docs/GLOSSARY.md} +4 -4
  31. package/Docs/HELPER_UTILITIES.md +885 -0
  32. package/Docs/HELPER_UTILITIES.md.meta +7 -0
  33. package/{INDEX.md → Docs/INDEX.md} +107 -62
  34. package/Docs/MATH_AND_EXTENSIONS.md +1039 -0
  35. package/{RANDOM_PERFORMANCE.md → Docs/RANDOM_PERFORMANCE.md} +15 -15
  36. package/{RELATIONAL_COMPONENTS.md → Docs/RELATIONAL_COMPONENTS.md} +111 -84
  37. package/{SERIALIZATION.md → Docs/SERIALIZATION.md} +15 -0
  38. package/{SPATIAL_TREES_2D_GUIDE.md → Docs/SPATIAL_TREES_2D_GUIDE.md} +2 -2
  39. package/{SPATIAL_TREES_3D_GUIDE.md → Docs/SPATIAL_TREES_3D_GUIDE.md} +1 -1
  40. package/Docs/SPATIAL_TREE_2D_PERFORMANCE.md +241 -0
  41. package/Docs/SPATIAL_TREE_3D_PERFORMANCE.md +243 -0
  42. package/{THIRD_PARTY_NOTICES.md → Docs/THIRD_PARTY_NOTICES.md} +1 -1
  43. package/Docs/UTILITY_COMPONENTS.md +906 -0
  44. package/Docs/UTILITY_COMPONENTS.md.meta +7 -0
  45. package/Docs/VISUAL_COMPONENTS.md +337 -0
  46. package/Docs/VISUAL_COMPONENTS.md.meta +7 -0
  47. package/Editor/AnimationEventEditor.cs +337 -160
  48. package/Editor/Core/Helper/AnimationEventHelpers.cs +178 -152
  49. package/Editor/CustomEditors/PersistentDirectoryGUI.cs +20 -11
  50. package/Editor/CustomEditors/TexturePlatformOverrideEntryDrawer.cs +11 -2
  51. package/Editor/FitTextureSizeWindow.cs +43 -19
  52. package/Editor/PersistentDirectorySettings.cs +64 -12
  53. package/Editor/PrefabChecker.cs +72 -5
  54. package/Editor/Sprites/AnimationCopier.cs +131 -55
  55. package/Editor/Sprites/AnimationCreator.cs +63 -22
  56. package/Editor/Sprites/AnimationViewerWindow.cs +42 -6
  57. package/Editor/Sprites/TexturePlatformNameHelper.cs +50 -39
  58. package/Editor/Sprites/TextureResizerWizard.cs +23 -1
  59. package/Editor/Sprites/TextureSettingsApplierWindow.cs +148 -85
  60. package/Editor/Tools/ImageBlurTool.cs +81 -10
  61. package/Editor/Utils/EditorUi.cs +1 -1
  62. package/Editor/Utils/ScriptableObjectSingletonCreator.cs +1 -1
  63. package/README.md +428 -2433
  64. package/Runtime/AssemblyInfo.cs +4 -0
  65. package/Runtime/Core/Attributes/NotNullAttribute.cs +1 -3
  66. package/Runtime/Core/Attributes/RelationalComponentAssigner.cs +50 -5
  67. package/Runtime/Core/DataStructure/CyclicBuffer.cs +0 -1
  68. package/Runtime/Core/DataStructure/KDTree3D.cs +1 -1
  69. package/Runtime/Core/DataStructure/OctTree3D.cs +1 -1
  70. package/Runtime/Core/Extension/AsyncOperationExtensions.cs +122 -0
  71. package/Runtime/Core/Extension/RandomExtensions.cs +68 -0
  72. package/Runtime/Core/Extension/WallstopStudiosLogger.cs +16 -0
  73. package/Runtime/Core/Helper/Partials/ObjectHelpers.cs +4 -1
  74. package/Runtime/Core/Helper/ReflectionHelpers.cs +21 -10
  75. package/Runtime/Core/Helper/SpriteHelpers.cs +3 -1
  76. package/Runtime/Core/Helper/UnityMainThreadDispatcher.cs +45 -1
  77. package/Runtime/Core/Serialization/JsonConverters/GameObjectConverter.cs +13 -5
  78. package/Runtime/Core/Serialization/JsonConverters/ResolutionConverter.cs +1 -1
  79. package/Runtime/Core/Serialization/JsonConverters/TypeConverter.cs +1 -1
  80. package/Runtime/Core/Serialization/ProtobufUnitySurrogates.cs +24 -29
  81. package/Runtime/Core/Serialization/Serializer.cs +101 -0
  82. package/Runtime/Integrations/Reflex/AssemblyInfo.cs +7 -0
  83. package/Runtime/Integrations/Reflex/AssemblyInfo.cs.meta +11 -0
  84. package/Runtime/Integrations/Reflex/ContainerRelationalExtensions.cs +198 -0
  85. package/Runtime/Integrations/Reflex/ContainerRelationalExtensions.cs.meta +11 -0
  86. package/Runtime/Integrations/Reflex/RelationalComponentsInstaller.cs +86 -0
  87. package/Runtime/Integrations/Reflex/RelationalComponentsInstaller.cs.meta +11 -0
  88. package/Runtime/Integrations/Reflex/RelationalReflexSceneBootstrapper.cs +316 -0
  89. package/Runtime/Integrations/Reflex/RelationalReflexSceneBootstrapper.cs.meta +11 -0
  90. package/Runtime/Integrations/Reflex/RelationalSceneAssignmentOptions.cs +86 -0
  91. package/Runtime/Integrations/Reflex/RelationalSceneAssignmentOptions.cs.meta +11 -0
  92. package/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Integration.Reflex.asmdef +20 -0
  93. package/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Integration.Reflex.asmdef.meta +7 -0
  94. package/Runtime/Integrations/Reflex.meta +8 -0
  95. package/Runtime/Integrations/VContainer/AssemblyInfo.cs +9 -0
  96. package/Runtime/Integrations/VContainer/AssemblyInfo.cs.meta +3 -0
  97. package/Runtime/Integrations/VContainer/ObjectResolverRelationalExtensions.cs +96 -0
  98. package/Runtime/Integrations/VContainer/RelationalComponentEntryPoint.cs +90 -10
  99. package/Runtime/Integrations/VContainer/RelationalComponentsBuilderExtensions.cs +13 -1
  100. package/Runtime/Integrations/VContainer/RelationalObjectPools.cs +114 -0
  101. package/Runtime/Integrations/VContainer/RelationalObjectPools.cs.meta +11 -0
  102. package/Runtime/Integrations/VContainer/RelationalSceneAssignmentOptions.cs +16 -4
  103. package/Runtime/Integrations/VContainer/RelationalSceneLoadListener.cs +241 -0
  104. package/Runtime/Integrations/VContainer/RelationalSceneLoadListener.cs.meta +11 -0
  105. package/Runtime/Integrations/Zenject/AssemblyInfo.cs +9 -0
  106. package/Runtime/Integrations/Zenject/AssemblyInfo.cs.meta +3 -0
  107. package/Runtime/Integrations/Zenject/DiContainerRelationalExtensions.cs +69 -2
  108. package/Runtime/Integrations/Zenject/RelationalComponentSceneInitializer.cs +89 -12
  109. package/Runtime/Integrations/Zenject/RelationalComponentsInstaller.cs +23 -1
  110. package/Runtime/Integrations/Zenject/RelationalMemoryPools.cs +44 -0
  111. package/Runtime/Integrations/Zenject/RelationalMemoryPools.cs.meta +11 -0
  112. package/Runtime/Integrations/Zenject/RelationalSceneAssignmentOptions.cs +16 -10
  113. package/Runtime/Integrations/Zenject/RelationalSceneLoadListener.cs +243 -0
  114. package/Runtime/Integrations/Zenject/RelationalSceneLoadListener.cs.meta +11 -0
  115. package/Runtime/Tags/AttributeMetadataCache.cs +1 -4
  116. package/Runtime/Utils/Buffers.cs +4 -4
  117. package/Runtime/Utils/ScriptableObjectSingleton.cs +1 -2
  118. package/Runtime/Utils/SetTextureImportData.cs +3 -1
  119. package/Runtime/Utils/TextureScale.cs +10 -2
  120. package/Runtime/Visuals/UGUI/EnhancedImage.cs +6 -0
  121. package/Runtime/Visuals/UIToolkit/LayeredImage.cs +4 -1
  122. package/Samples~/DI - Reflex/README.md +527 -0
  123. package/Samples~/DI - Reflex/README.md.meta +7 -0
  124. package/Samples~/DI - Reflex/Scripts/ReflexPaletteService.cs +36 -0
  125. package/Samples~/DI - Reflex/Scripts/ReflexPaletteService.cs.meta +11 -0
  126. package/Samples~/DI - Reflex/Scripts/ReflexRelationalConsumer.cs +79 -0
  127. package/Samples~/DI - Reflex/Scripts/ReflexRelationalConsumer.cs.meta +11 -0
  128. package/Samples~/DI - Reflex/Scripts/ReflexSampleInstaller.cs +30 -0
  129. package/Samples~/DI - Reflex/Scripts/ReflexSampleInstaller.cs.meta +11 -0
  130. package/Samples~/DI - Reflex/Scripts/ReflexSpawner.cs +79 -0
  131. package/Samples~/DI - Reflex/Scripts/ReflexSpawner.cs.meta +11 -0
  132. package/Samples~/DI - Reflex/Scripts/Samples.UnityHelpers.DI.Reflex.asmdef +26 -0
  133. package/Samples~/DI - Reflex/Scripts/Samples.UnityHelpers.DI.Reflex.asmdef.meta +9 -0
  134. package/Samples~/DI - Reflex/Scripts.meta +8 -0
  135. package/Samples~/DI - Reflex.meta +8 -0
  136. package/Samples~/DI - VContainer/README.md +238 -56
  137. package/Samples~/DI - VContainer/Scripts/GameLifetimeScope.cs +22 -4
  138. package/Samples~/DI - VContainer/Scripts/RelationalConsumer.cs +5 -2
  139. package/Samples~/DI - VContainer/Scripts/Spawner.cs +113 -4
  140. package/Samples~/DI - Zenject/README.md +223 -58
  141. package/Samples~/DI - Zenject/Scripts/RelationalConsumer.cs +3 -0
  142. package/Samples~/DI - Zenject/Scripts/RelationalConsumerPool.cs +37 -0
  143. package/Samples~/DI - Zenject/Scripts/RelationalConsumerPool.cs.meta +12 -0
  144. package/Samples~/DI - Zenject/Scripts/SpawnerZenject.cs +74 -3
  145. package/Samples~/Random - PRNG/README.md +2 -1
  146. package/Samples~/Relational Components - Basic/README.md +3 -1
  147. package/Samples~/Serialization - JSON/README.md +2 -1
  148. package/Samples~/Spatial Structures - 2D and 3D/README.md +2 -1
  149. package/Samples~/UGUI - EnhancedImage/README.md +2 -1
  150. package/Samples~/UI Toolkit - MultiFile Selector (Editor)/README.md +2 -1
  151. package/Tests/Editor/Attributes/AnimationEventHelpersTests.cs +16 -0
  152. package/Tests/Editor/Core/Attributes/RelationalComponentAssignerTests.cs +32 -34
  153. package/Tests/Editor/Integrations/Reflex/ReflexIntegrationCompilationTests.cs +41 -0
  154. package/Tests/Editor/Integrations/Reflex/ReflexIntegrationCompilationTests.cs.meta +11 -0
  155. package/Tests/Editor/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Editor.Reflex.asmdef +27 -0
  156. package/Tests/Editor/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Editor.Reflex.asmdef.meta +7 -0
  157. package/Tests/Editor/Integrations/Reflex.meta +8 -0
  158. package/Tests/Editor/Integrations/VContainer/VContainerRelationalEntryPointTests.cs +21 -18
  159. package/Tests/Editor/Integrations/VContainer/VContainerRelationalHelpersTests.cs +164 -0
  160. package/Tests/Editor/Integrations/VContainer/VContainerRelationalHelpersTests.cs.meta +11 -0
  161. package/Tests/Editor/Integrations/VContainer/WallstopStudios.UnityHelpers.Tests.Editor.VContainer.asmdef +2 -1
  162. package/Tests/Editor/Integrations/Zenject/WallstopStudios.UnityHelpers.Tests.Editor.Zenject.asmdef +3 -2
  163. package/Tests/Editor/Integrations/Zenject/ZenjectRelationalHelpersTests.cs +127 -0
  164. package/Tests/Editor/Integrations/Zenject/ZenjectRelationalHelpersTests.cs.meta +11 -0
  165. package/Tests/Editor/Integrations/Zenject/ZenjectRelationalInitializerTests.cs +25 -23
  166. package/Tests/Editor/PersistentDirectorySettingsTests.cs +58 -0
  167. package/Tests/Editor/PersistentDirectorySettingsTests.cs.meta +11 -0
  168. package/Tests/Editor/PrefabCheckerReportTests.cs +32 -0
  169. package/Tests/Editor/PrefabCheckerReportTests.cs.meta +11 -0
  170. package/Tests/Editor/Sprites/AnimationCopierFilterTests.cs +63 -0
  171. package/Tests/Editor/Sprites/AnimationCopierFilterTests.cs.meta +11 -0
  172. package/Tests/Editor/Sprites/AnimationCopierWindowTests.cs +1 -1
  173. package/Tests/Editor/Sprites/AnimationViewerWindowTests.cs +38 -0
  174. package/Tests/Editor/Sprites/AnimationViewerWindowTests.cs.meta +11 -0
  175. package/Tests/Editor/Sprites/ScriptableSpriteAtlasEditorTests.cs +1 -1
  176. package/Tests/Editor/Sprites/SpriteCropperAdditionalTests.cs +12 -12
  177. package/Tests/Editor/Sprites/SpriteCropperTests.cs +9 -9
  178. package/Tests/Editor/Sprites/SpritePivotAdjusterTests.cs +3 -3
  179. package/Tests/Editor/Sprites/TexturePlatformNameHelperTests.cs +18 -0
  180. package/Tests/Editor/Sprites/TextureResizerWizardTests.cs +5 -5
  181. package/Tests/Editor/Sprites/TextureSettingsApplierAPITests.cs +3 -3
  182. package/Tests/Editor/Sprites/TextureSettingsApplierWizardAdditionalTests.cs +4 -4
  183. package/Tests/Editor/Sprites/TextureSettingsApplierWizardTests.cs +4 -4
  184. package/Tests/Editor/Tools/ImageBlurToolTests.cs +22 -110
  185. package/Tests/Editor/Utils/CommonTestBase.cs +60 -1
  186. package/Tests/Editor/Utils/ScriptableObjectSingletonCreatorTests.cs +6 -6
  187. package/Tests/Editor/Windows/FitTextureSizeWindowTests.cs +66 -74
  188. package/Tests/Runtime/Attributes/RelationalComponentInitializerTests.cs +4 -15
  189. package/Tests/Runtime/DataStructures/SpatialTree3DBoundsConsistencyTests.cs +29 -29
  190. package/Tests/Runtime/Extensions/AsyncOperationExtensionsTests.cs +179 -0
  191. package/Tests/Runtime/Extensions/RandomExtensionTests.cs +55 -0
  192. package/Tests/Runtime/Integrations/Reflex/RelationalComponentsReflexTests.cs +445 -0
  193. package/Tests/Runtime/Integrations/Reflex/RelationalComponentsReflexTests.cs.meta +11 -0
  194. package/Tests/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Runtime.Reflex.asmdef +28 -0
  195. package/Tests/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Runtime.Reflex.asmdef.meta +7 -0
  196. package/Tests/Runtime/Integrations/Reflex.meta +8 -0
  197. package/Tests/Runtime/Integrations/VContainer/RelationalComponentsVContainerTests.cs +257 -221
  198. package/Tests/Runtime/Integrations/VContainer/RelationalObjectPoolsVContainerTests.cs +91 -0
  199. package/Tests/Runtime/Integrations/VContainer/RelationalObjectPoolsVContainerTests.cs.meta +11 -0
  200. package/Tests/Runtime/Integrations/Zenject/RelationalComponentsZenjectTests.cs +251 -233
  201. package/Tests/Runtime/Performance/RandomPerformanceTests.cs +1 -1
  202. package/Tests/Runtime/Performance/SpatialTree2DPerformanceTests.cs +6 -1
  203. package/Tests/Runtime/Performance/SpatialTree3DPerformanceTests.cs +4 -1
  204. package/Tests/Runtime/Serialization/JsonConverterAdditionalTests.cs +30 -0
  205. package/Tests/Runtime/Serialization/JsonConverterAdditionalTests.cs.meta +11 -0
  206. package/Tests/Runtime/Serialization/JsonConverterTests.cs +8 -12
  207. package/Tests/Runtime/Serialization/JsonRoundtripComprehensiveTests.cs +4 -9
  208. package/Tests/Runtime/Serialization/JsonSerializationTest.cs +16 -5
  209. package/Tests/Runtime/Serialization/ProtoRoundtripComprehensiveTests.cs +13 -13
  210. package/Tests/Runtime/Serialization/SerializerAdditionalTests.cs +12 -0
  211. package/Tests/Runtime/Serialization/SerializerFileIoTests.cs +105 -0
  212. package/Tests/Runtime/Serialization/SerializerFileIoTests.cs.meta +11 -0
  213. package/Tests/Runtime/Serialization/UnityEngineObjectJsonTests.cs +247 -0
  214. package/Tests/Runtime/Serialization/UnityEngineObjectJsonTests.cs.meta +11 -0
  215. package/Tests/Runtime/TestUtils/CommonTestBase.cs +99 -0
  216. package/Tests/Runtime/TestUtils/ReflexTestSupport.cs +111 -0
  217. package/Tests/Runtime/TestUtils/ReflexTestSupport.cs.meta +12 -0
  218. package/Tests/Runtime/Utils/CoroutineHandlerTests.cs +1 -1
  219. package/Tests/Runtime/Utils/LZMAComprehensiveTests.cs +1 -1
  220. package/Tests/Runtime/Utils/LZMATests.cs +1 -1
  221. package/Tests/Runtime/Utils/MatchColliderToSpriteTests.cs +5 -5
  222. package/Tests/Runtime/Visuals/EnhancedImageTests.cs +25 -56
  223. package/Tests/Runtime/Visuals/VisualsTestHelpers.cs +1 -8
  224. package/Tests/TestUtils.meta +8 -0
  225. package/package-lock.json.meta +7 -0
  226. package/package.json +13 -4
  227. package/scripts/check-eol.ps1 +4 -5
  228. package/scripts/lint-tests.ps1 +156 -0
  229. package/scripts/lint-tests.ps1.meta +7 -0
  230. package/scripts/normalize-eol.ps1 +6 -9
  231. package/.github/workflows/csharpier.yml +0 -135
  232. package/CHANGELOG.md +0 -0
  233. package/EFFECTS_SYSTEM.md +0 -242
  234. package/MATH_AND_EXTENSIONS.md +0 -316
  235. package/SPATIAL_TREE_2D_PERFORMANCE.md +0 -238
  236. package/SPATIAL_TREE_3D_PERFORMANCE.md +0 -240
  237. /package/{CHANGELOG.md.meta → Docs/CHANGELOG.md.meta} +0 -0
  238. /package/{DATA_STRUCTURES.md → Docs/DATA_STRUCTURES.md} +0 -0
  239. /package/{DATA_STRUCTURES.md.meta → Docs/DATA_STRUCTURES.md.meta} +0 -0
  240. /package/{EDITOR_TOOLS_GUIDE.md.meta → Docs/EDITOR_TOOLS_GUIDE.md.meta} +0 -0
  241. /package/{EFFECTS_SYSTEM.md.meta → Docs/EFFECTS_SYSTEM.md.meta} +0 -0
  242. /package/{EFFECTS_SYSTEM_TUTORIAL.md.meta → Docs/EFFECTS_SYSTEM_TUTORIAL.md.meta} +0 -0
  243. /package/{GETTING_STARTED.md.meta → Docs/GETTING_STARTED.md.meta} +0 -0
  244. /package/{GLOSSARY.md.meta → Docs/GLOSSARY.md.meta} +0 -0
  245. /package/{HULLS.md → Docs/HULLS.md} +0 -0
  246. /package/{HULLS.md.meta → Docs/HULLS.md.meta} +0 -0
  247. /package/{INDEX.md.meta → Docs/INDEX.md.meta} +0 -0
  248. /package/{LICENSE.md → Docs/LICENSE.md} +0 -0
  249. /package/{LICENSE.md.meta → Docs/LICENSE.md.meta} +0 -0
  250. /package/{MATH_AND_EXTENSIONS.md.meta → Docs/MATH_AND_EXTENSIONS.md.meta} +0 -0
  251. /package/{RANDOM_PERFORMANCE.md.meta → Docs/RANDOM_PERFORMANCE.md.meta} +0 -0
  252. /package/{REFLECTION_HELPERS.md → Docs/REFLECTION_HELPERS.md} +0 -0
  253. /package/{REFLECTION_HELPERS.md.meta → Docs/REFLECTION_HELPERS.md.meta} +0 -0
  254. /package/{RELATIONAL_COMPONENTS.md.meta → Docs/RELATIONAL_COMPONENTS.md.meta} +0 -0
  255. /package/{SERIALIZATION.md.meta → Docs/SERIALIZATION.md.meta} +0 -0
  256. /package/{SINGLETONS.md → Docs/SINGLETONS.md} +0 -0
  257. /package/{SINGLETONS.md.meta → Docs/SINGLETONS.md.meta} +0 -0
  258. /package/{SPATIAL_TREES_2D_GUIDE.md.meta → Docs/SPATIAL_TREES_2D_GUIDE.md.meta} +0 -0
  259. /package/{SPATIAL_TREES_3D_GUIDE.md.meta → Docs/SPATIAL_TREES_3D_GUIDE.md.meta} +0 -0
  260. /package/{SPATIAL_TREE_2D_PERFORMANCE.md.meta → Docs/SPATIAL_TREE_2D_PERFORMANCE.md.meta} +0 -0
  261. /package/{SPATIAL_TREE_3D_PERFORMANCE.md.meta → Docs/SPATIAL_TREE_3D_PERFORMANCE.md.meta} +0 -0
  262. /package/{SPATIAL_TREE_SEMANTICS.md → Docs/SPATIAL_TREE_SEMANTICS.md} +0 -0
  263. /package/{SPATIAL_TREE_SEMANTICS.md.meta → Docs/SPATIAL_TREE_SEMANTICS.md.meta} +0 -0
  264. /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.IsNotNull(imp);
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<UnityEngine.Object>
48
+ window._directoryPaths = new System.Collections.Generic.List<Object>
49
49
  {
50
- AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(Root),
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.IsNotNull(tex, "Texture should exist after resize");
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.IsNotNull(outAsset, "Output folder asset missing");
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.IsNotNull(outTex, "Expected resized texture in output folder");
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.IsNotNull(importer);
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.IsNotNull(importer);
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.IsNotNull(importer);
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.IsNotNull(importer);
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.IsNotNull(importer);
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.IsNotNull(impIncluded);
79
- Assert.IsNotNull(impOther);
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.IsNotNull(imp);
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.IsNotNull(imp);
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<UnityEngine.Object>
51
+ window.directories = new System.Collections.Generic.List<Object>
52
52
  {
53
- AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(Root),
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.IsNotNull(impA);
73
- Assert.IsNotNull(impB);
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 Object = UnityEngine.Object;
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 GenerateGaussianKernelIsNormalizedAndSymmetric()
11
+ public void KernelHasExpectedLengthAndNormalizes()
31
12
  {
32
- float[] k = WallstopStudios.UnityHelpers.Editor.Tools.ImageBlurTool.KernelForTests(5);
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
- Assert.That(
42
- Mathf.Abs(k[i] - k[k.Length - 1 - i]) < 1e-6f,
43
- $"Kernel must be symmetric at {i}"
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 CreateBlurredTextureSoftensHighContrastPixel()
28
+ public void BlurredTextureMatchesInputDimensions()
50
29
  {
51
- Texture2D src = new(5, 5, TextureFormat.RGBA32, false);
52
- Color[] pixels = Enumerable.Repeat(Color.black, 25).ToArray();
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
- string next = cur + "/" + parts[i];
102
- if (!AssetDatabase.IsValidFolder(next))
33
+ for (int x = 0; x < tex.width; x++)
103
34
  {
104
- AssetDatabase.CreateFolder(cur, parts[i]);
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
- private static string RelToFull(string rel)
123
- {
124
- return Path.Combine(
125
- Application.dataPath.Substring(
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.IsNotNull(AssetDatabase.LoadAssetAtPath<Object>(assetPath));
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 TextAsset("occupied");
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.IsNull(
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.IsNull(
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