com.wallstop-studios.unity-helpers 2.0.0-rc81.6 → 2.0.0-rc81.9
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/.config/dotnet-tools.json +10 -10
- package/.csharpierignore +1 -0
- package/.csharpierrc.json +3 -0
- package/.editorconfig +184 -184
- package/.gitattributes +87 -63
- package/.githooks/pre-commit +49 -0
- package/.github/dependabot.yml +9 -9
- package/.github/workflows/csharpier.yml +135 -0
- package/.github/workflows/lint-doc-links.yml +27 -0
- package/.github/workflows/markdown-json.yml +41 -0
- package/.github/workflows/npm-publish.yml +75 -75
- package/.lychee.toml +26 -0
- package/.markdownlint.json +21 -0
- package/.markdownlintignore +8 -0
- package/.pre-commit-config.yaml +39 -22
- package/.prettierignore +22 -0
- package/.prettierrc.json +20 -0
- package/AGENTS.md +52 -0
- package/{Third Party Notices.md.meta → AGENTS.md.meta} +7 -7
- package/CHANGELOG.md.meta +7 -7
- package/DATA_STRUCTURES.md +324 -0
- package/DATA_STRUCTURES.md.meta +7 -0
- package/Docs/Images/attribute_resolution.svg +40 -0
- package/Docs/Images/attribute_resolution.svg.meta +7 -0
- package/Docs/Images/bitset.svg +47 -0
- package/Docs/Images/bitset.svg.meta +7 -0
- package/Docs/Images/concave_hull.svg +30 -0
- package/Docs/Images/concave_hull.svg.meta +7 -0
- package/Docs/Images/convex_hull.svg +29 -0
- package/Docs/Images/convex_hull.svg.meta +7 -0
- package/Docs/Images/cyclic_buffer.svg +37 -0
- package/Docs/Images/cyclic_buffer.svg.meta +7 -0
- package/Docs/Images/data_distribution_decision.svg +88 -0
- package/Docs/Images/data_distribution_decision.svg.meta +7 -0
- package/Docs/Images/deque.svg +64 -0
- package/Docs/Images/deque.svg.meta +7 -0
- package/Docs/Images/deque_queue.svg +107 -0
- package/Docs/Images/deque_queue.svg.meta +7 -0
- package/Docs/Images/disjoint_set.svg +47 -0
- package/Docs/Images/disjoint_set.svg.meta +7 -0
- package/Docs/Images/effects_pipeline.svg +59 -0
- package/Docs/Images/effects_pipeline.svg.meta +7 -0
- package/Docs/Images/geometry_edge_cases.svg +61 -0
- package/Docs/Images/geometry_edge_cases.svg.meta +7 -0
- package/Docs/Images/heap.svg +56 -0
- package/Docs/Images/heap.svg.meta +7 -0
- package/Docs/Images/kdtree_2d.svg +38 -0
- package/Docs/Images/kdtree_2d.svg.meta +7 -0
- package/Docs/Images/kdtree_3d.svg +83 -0
- package/Docs/Images/kdtree_3d.svg.meta +7 -0
- package/Docs/Images/octree_3d.svg +79 -0
- package/Docs/Images/octree_3d.svg.meta +7 -0
- package/Docs/Images/polyline_simplify.svg +18 -0
- package/Docs/Images/polyline_simplify.svg.meta +7 -0
- package/Docs/Images/quadtree_2d.svg +37 -0
- package/Docs/Images/quadtree_2d.svg.meta +7 -0
- package/Docs/Images/query_boundaries.svg +38 -0
- package/Docs/Images/query_boundaries.svg.meta +7 -0
- package/Docs/Images/random_generators.svg +105 -0
- package/Docs/Images/random_generators.svg.meta +7 -0
- package/Docs/Images/reflection_scan.svg +33 -0
- package/Docs/Images/reflection_scan.svg.meta +7 -0
- package/Docs/Images/relational_wiring.svg +75 -0
- package/Docs/Images/relational_wiring.svg.meta +7 -0
- package/Docs/Images/rtree_2d.svg +27 -0
- package/Docs/Images/rtree_2d.svg.meta +7 -0
- package/Docs/Images/rtree_3d.svg +79 -0
- package/Docs/Images/rtree_3d.svg.meta +7 -0
- package/Docs/Images/serialization_flow.svg +50 -0
- package/Docs/Images/serialization_flow.svg.meta +7 -0
- package/Docs/Images/singletons_lifecycle.svg +54 -0
- package/Docs/Images/singletons_lifecycle.svg.meta +7 -0
- package/Docs/Images/sparse_set.svg +54 -0
- package/Docs/Images/sparse_set.svg.meta +7 -0
- package/Docs/Images/trie.svg +55 -0
- package/Docs/Images/trie.svg.meta +7 -0
- package/Docs/Images.meta +8 -0
- package/Docs.meta +8 -0
- package/EDITOR_TOOLS_GUIDE.md +1976 -0
- package/EDITOR_TOOLS_GUIDE.md.meta +7 -0
- package/EFFECTS_SYSTEM.md +242 -0
- package/EFFECTS_SYSTEM.md.meta +7 -0
- package/EFFECTS_SYSTEM_TUTORIAL.md +467 -0
- package/EFFECTS_SYSTEM_TUTORIAL.md.meta +7 -0
- package/Editor/AnimationEventEditor.cs +1393 -874
- package/Editor/AnimationEventEditor.cs.meta +11 -11
- package/Editor/AssemblyInfo.cs +4 -0
- package/Editor/AssemblyInfo.cs.meta +3 -0
- package/Editor/AssetProcessors/SpriteLabelProcessor.cs +138 -111
- package/Editor/AssetProcessors/SpriteLabelProcessor.cs.meta +2 -2
- package/Editor/AssetProcessors.meta +2 -2
- package/Editor/Core/Helper/AnimationEventHelpers.cs +204 -0
- package/{Runtime/Core/DataStructure/ISpatialTree.cs.meta → Editor/Core/Helper/AnimationEventHelpers.cs.meta} +11 -11
- package/Editor/Core/Helper.meta +8 -0
- package/Editor/Core.meta +8 -0
- package/Editor/CustomDrawers/IntDropdownDrawer.cs +46 -46
- package/Editor/CustomDrawers/IntDropdownDrawer.cs.meta +2 -2
- package/Editor/CustomDrawers/StringInListeDrawer.cs +135 -135
- package/Editor/CustomDrawers/StringInListeDrawer.cs.meta +2 -2
- package/Editor/CustomDrawers/WShowIfPropertyDrawer.cs +105 -105
- package/Editor/CustomDrawers/WShowIfPropertyDrawer.cs.meta +2 -2
- package/Editor/CustomDrawers.meta +2 -2
- package/Editor/CustomEditors/MatchColliderToSpriteEditor.cs +32 -32
- package/Editor/CustomEditors/MatchColliderToSpriteEditor.cs.meta +2 -2
- package/Editor/CustomEditors/PersistentDirectoryGUI.cs +799 -799
- package/Editor/CustomEditors/PersistentDirectoryGUI.cs.meta +2 -2
- package/Editor/CustomEditors/PolygonCollider2DOptimizerEditor.cs +38 -40
- package/Editor/CustomEditors/PolygonCollider2DOptimizerEditor.cs.meta +2 -2
- package/Editor/CustomEditors/SourceFolderEntryDrawer.cs +685 -413
- package/Editor/CustomEditors/SourceFolderEntryDrawer.cs.meta +2 -2
- package/Editor/CustomEditors/TexturePlatformOverrideEntryDrawer.cs +146 -0
- package/{Runtime/Core/DataStructure/KDTree.cs.meta → Editor/CustomEditors/TexturePlatformOverrideEntryDrawer.cs.meta} +11 -11
- package/Editor/CustomEditors.meta +2 -2
- package/Editor/Extensions/SerializedPropertyExtensions.cs +217 -190
- package/Editor/Extensions/SerializedPropertyExtensions.cs.meta +2 -2
- package/Editor/Extensions/UnityExtensions.cs +50 -26
- package/Editor/Extensions/UnityExtensions.cs.meta +2 -2
- package/Editor/Extensions.meta +2 -2
- package/Editor/FitTextureSizeWindow.cs +785 -332
- package/Editor/FitTextureSizeWindow.cs.meta +2 -2
- package/Editor/Persistence/MultiFileSelectorPersistenceManager.cs +62 -0
- package/{Runtime/Core/DataStructure/QuadTree.cs.meta → Editor/Persistence/MultiFileSelectorPersistenceManager.cs.meta} +11 -11
- package/Editor/Persistence/MultiFileSelectorPersistenceWindow.cs +65 -0
- package/Editor/Persistence/MultiFileSelectorPersistenceWindow.cs.meta +11 -0
- package/Editor/Persistence.meta +8 -0
- package/Editor/PersistentDirectorySettings.cs +529 -248
- package/Editor/PersistentDirectorySettings.cs.meta +2 -2
- package/Editor/PrefabChecker.cs +1329 -741
- package/Editor/PrefabChecker.cs.meta +11 -11
- package/Editor/Sprites/AnimationCopier.cs +1518 -789
- package/Editor/Sprites/AnimationCopier.cs.meta +2 -2
- package/Editor/Sprites/AnimationCreator.cs +1532 -881
- package/Editor/Sprites/AnimationCreator.cs.meta +11 -11
- package/Editor/Sprites/AnimationViewerWindow.cs +1634 -1522
- package/Editor/Sprites/AnimationViewerWindow.cs.meta +2 -2
- package/Editor/Sprites/ScriptableSpriteAtlas.cs +251 -178
- package/Editor/Sprites/ScriptableSpriteAtlas.cs.meta +2 -2
- package/Editor/Sprites/ScriptableSpriteAtlasEditor.cs +1470 -1026
- package/Editor/Sprites/ScriptableSpriteAtlasEditor.cs.meta +2 -2
- package/Editor/Sprites/SpriteCropper.cs +1013 -523
- package/Editor/Sprites/SpriteCropper.cs.meta +2 -2
- package/Editor/Sprites/SpritePivotAdjustor.cs +605 -265
- package/Editor/Sprites/SpritePivotAdjustor.cs.meta +2 -2
- package/Editor/Sprites/SpriteSettingsApplier.cs +942 -918
- package/Editor/Sprites/SpriteSettingsApplier.cs.meta +2 -2
- package/Editor/Sprites/SpriteSettingsApplierAPI.cs +441 -0
- package/Editor/Sprites/SpriteSettingsApplierAPI.cs.meta +11 -0
- package/Editor/Sprites/SpriteSettingsProfileCollection.cs +12 -0
- package/Editor/Sprites/SpriteSettingsProfileCollection.cs.meta +11 -0
- package/Editor/Sprites/SpriteSheetAnimationCreator.cs +1586 -1537
- package/Editor/Sprites/SpriteSheetAnimationCreator.cs.meta +2 -2
- package/Editor/Sprites/TexturePlatformNameHelper.cs +78 -0
- package/Editor/Sprites/TexturePlatformNameHelper.cs.meta +11 -0
- package/Editor/Sprites/TextureResizerWizard.cs +434 -175
- package/Editor/Sprites/TextureResizerWizard.cs.meta +2 -2
- package/Editor/Sprites/TextureSettingsApplierAPI.cs +359 -0
- package/Editor/Sprites/TextureSettingsApplierAPI.cs.meta +11 -0
- package/Editor/Sprites/TextureSettingsApplierWindow.cs +605 -0
- package/Editor/Sprites/TextureSettingsApplierWindow.cs.meta +11 -0
- package/Editor/Sprites.meta +2 -2
- package/Editor/Styles/AnimationViewer.uss +115 -115
- package/Editor/Styles/AnimationViewer.uss.meta +2 -2
- package/Editor/Styles/AnimationViewer.uxml +56 -56
- package/Editor/Styles/AnimationViewer.uxml.meta +2 -2
- package/Editor/Styles/SpriteSheetAnimationCreator.uss +10 -0
- package/Editor/Styles/SpriteSheetAnimationCreator.uss.meta +11 -0
- package/Editor/Styles.meta +2 -2
- package/Editor/Tags/AttributeMetadataCacheEditor.cs +46 -0
- package/Editor/Tags/AttributeMetadataCacheEditor.cs.meta +11 -0
- package/Editor/Tags/AttributeMetadataCacheGenerator.cs +258 -0
- package/Editor/Tags/AttributeMetadataCacheGenerator.cs.meta +11 -0
- package/Editor/Tags.meta +8 -0
- package/Editor/Tools/ImageBlurTool.cs +451 -409
- package/Editor/Tools/ImageBlurTool.cs.meta +2 -2
- package/Editor/Tools.meta +2 -2
- package/Editor/Utils/DxReadOnlyPropertyDrawer.cs +26 -26
- package/Editor/Utils/DxReadOnlyPropertyDrawer.cs.meta +11 -11
- package/Editor/Utils/EditorUi.cs +228 -0
- package/Editor/Utils/EditorUi.cs.meta +11 -0
- package/Editor/Utils/EditorUtilities.cs +22 -22
- package/Editor/Utils/EditorUtilities.cs.meta +11 -11
- package/Editor/Utils/ScriptableObjectSingletonCreator.cs +633 -52
- package/Editor/Utils/ScriptableObjectSingletonCreator.cs.meta +2 -2
- package/Editor/Utils.meta +8 -8
- package/Editor/Visuals/EnhancedImageEditor.cs +160 -160
- package/Editor/Visuals/EnhancedImageEditor.cs.meta +11 -11
- package/Editor/Visuals.meta +2 -2
- package/Editor/WallstopStudios.UnityHelpers.Editor.asmdef +14 -18
- package/Editor/WallstopStudios.UnityHelpers.Editor.asmdef.meta +7 -7
- package/Editor.meta +8 -8
- package/GETTING_STARTED.md +425 -0
- package/GETTING_STARTED.md.meta +7 -0
- package/GLOSSARY.md +313 -0
- package/GLOSSARY.md.meta +7 -0
- package/HULLS.md +45 -0
- package/HULLS.md.meta +7 -0
- package/INDEX.md +429 -0
- package/INDEX.md.meta +7 -0
- package/LICENSE +21 -21
- package/LICENSE.md +7 -7
- package/LICENSE.md.meta +7 -7
- package/LICENSE.meta +7 -7
- package/MATH_AND_EXTENSIONS.md +316 -0
- package/MATH_AND_EXTENSIONS.md.meta +7 -0
- package/RANDOM_PERFORMANCE.md +140 -0
- package/RANDOM_PERFORMANCE.md.meta +7 -0
- package/README.md +3195 -188
- package/README.md.meta +7 -7
- package/REFLECTION_HELPERS.md +272 -0
- package/REFLECTION_HELPERS.md.meta +7 -0
- package/RELATIONAL_COMPONENTS.md +543 -0
- package/RELATIONAL_COMPONENTS.md.meta +7 -0
- package/Runtime/AssemblyInfo.cs +7 -0
- package/Runtime/AssemblyInfo.cs.meta +11 -0
- package/Runtime/Binaries/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/Runtime/Binaries/Microsoft.Bcl.AsyncInterfaces.dll.meta +33 -33
- package/Runtime/Binaries/Microsoft.Bcl.AsyncInterfaces.xml +499 -278
- package/Runtime/Binaries/Microsoft.Bcl.AsyncInterfaces.xml.meta +7 -7
- package/Runtime/Binaries/System.IO.Pipelines.dll +0 -0
- package/Runtime/Binaries/System.IO.Pipelines.dll.meta +33 -0
- package/Runtime/Binaries/System.IO.Pipelines.xml +702 -0
- package/Runtime/Binaries/System.IO.Pipelines.xml.meta +7 -0
- package/Runtime/Binaries/System.Text.Encodings.Web.dll +0 -0
- package/Runtime/Binaries/System.Text.Encodings.Web.dll.meta +33 -33
- package/Runtime/Binaries/System.Text.Encodings.Web.xml +1084 -1079
- package/Runtime/Binaries/System.Text.Encodings.Web.xml.meta +7 -7
- package/Runtime/Binaries/System.Text.Json.dll +0 -0
- package/Runtime/Binaries/System.Text.Json.dll.meta +33 -33
- package/Runtime/Binaries/System.Text.Json.xml +10217 -8116
- package/Runtime/Binaries/System.Text.Json.xml.meta +7 -7
- package/Runtime/Binaries.meta +8 -8
- package/Runtime/Core/Attributes/AnimationEventAttribute.cs +10 -138
- package/Runtime/Core/Attributes/AnimationEventAttribute.cs.meta +11 -11
- package/Runtime/Core/Attributes/BaseRelationalComponentAttribute.cs +841 -0
- package/Runtime/Core/Attributes/BaseRelationalComponentAttribute.cs.meta +11 -0
- package/Runtime/Core/Attributes/ChildComponentAttribute.cs +284 -226
- package/Runtime/Core/Attributes/ChildComponentAttribute.cs.meta +11 -11
- package/Runtime/Core/Attributes/DxReadOnlyAttribute.cs +6 -6
- package/Runtime/Core/Attributes/DxReadOnlyAttribute.cs.meta +11 -11
- package/Runtime/Core/Attributes/EnumDisplayNameAttribute.cs +15 -15
- package/Runtime/Core/Attributes/EnumDisplayNameAttribute.cs.meta +2 -2
- package/Runtime/Core/Attributes/IRelationalComponentAssigner.cs +36 -0
- package/Runtime/Core/Attributes/IRelationalComponentAssigner.cs.meta +11 -0
- package/Runtime/Core/Attributes/IntDropdownAttribute.cs +14 -14
- package/Runtime/Core/Attributes/IntDropdownAttribute.cs.meta +2 -2
- package/Runtime/Core/Attributes/KSerializableAttribute.cs +19 -19
- package/Runtime/Core/Attributes/KSerializableAttribute.cs.meta +11 -11
- package/Runtime/Core/Attributes/NotNullAttribute.cs +32 -32
- package/Runtime/Core/Attributes/NotNullAttribute.cs.meta +11 -11
- package/Runtime/Core/Attributes/ParentComponentAttribute.cs +376 -0
- package/Runtime/Core/Attributes/{ParentComponent.cs.meta → ParentComponentAttribute.cs.meta} +11 -11
- package/Runtime/Core/Attributes/RelationalComponentAssigner.cs +107 -0
- package/Runtime/Core/Attributes/RelationalComponentAssigner.cs.meta +11 -0
- package/Runtime/Core/Attributes/RelationalComponentExtensions.cs +61 -14
- package/Runtime/Core/Attributes/RelationalComponentExtensions.cs.meta +11 -11
- package/Runtime/Core/Attributes/RelationalComponentInitializer.cs +331 -0
- package/Runtime/Core/Attributes/RelationalComponentInitializer.cs.meta +11 -0
- package/Runtime/Core/Attributes/ScriptableSingletonPathAttribute.cs +15 -15
- package/Runtime/Core/Attributes/ScriptableSingletonPathAttribute.cs.meta +2 -2
- package/Runtime/Core/Attributes/SiblingComponentAttribute.cs +264 -137
- package/Runtime/Core/Attributes/SiblingComponentAttribute.cs.meta +11 -11
- package/Runtime/Core/Attributes/ValidateAssignmentAttribute.cs +115 -106
- package/Runtime/Core/Attributes/ValidateAssignmentAttribute.cs.meta +11 -11
- package/Runtime/Core/Attributes/ValueHelpers.cs +10 -0
- package/Runtime/Core/Attributes/ValueHelpers.cs.meta +3 -0
- package/Runtime/Core/Attributes/WShowIfAttribute.cs +24 -24
- package/Runtime/Core/Attributes/WShowIfAttribute.cs.meta +2 -2
- package/Runtime/Core/Attributes.meta +8 -8
- package/Runtime/Core/DataStructure/Adapters/FastVector2Int.cs +192 -92
- package/Runtime/Core/DataStructure/Adapters/FastVector2Int.cs.meta +11 -11
- package/Runtime/Core/DataStructure/Adapters/FastVector3Int.cs +268 -185
- package/Runtime/Core/DataStructure/Adapters/FastVector3Int.cs.meta +11 -11
- package/Runtime/Core/DataStructure/Adapters/KGuid.cs +360 -305
- package/Runtime/Core/DataStructure/Adapters/KGuid.cs.meta +11 -11
- package/Runtime/Core/DataStructure/Adapters/KVector2.cs +146 -80
- package/Runtime/Core/DataStructure/Adapters/KVector2.cs.meta +11 -11
- package/Runtime/Core/DataStructure/Adapters.meta +8 -8
- package/Runtime/Core/DataStructure/BitSet.cs +626 -0
- package/Runtime/Core/DataStructure/BitSet.cs.meta +11 -0
- package/Runtime/Core/DataStructure/BoundingBox3D.cs +405 -0
- package/Runtime/Core/DataStructure/BoundingBox3D.cs.meta +11 -0
- package/Runtime/Core/DataStructure/Circle.cs +203 -50
- package/Runtime/Core/DataStructure/Circle.cs.meta +11 -11
- package/Runtime/Core/DataStructure/CyclicBuffer.cs +489 -266
- package/Runtime/Core/DataStructure/CyclicBuffer.cs.meta +11 -11
- package/Runtime/Core/DataStructure/Deque.cs +561 -0
- package/Runtime/Core/DataStructure/Deque.cs.meta +11 -0
- package/Runtime/Core/DataStructure/DisjointSet.cs +483 -0
- package/Runtime/Core/DataStructure/DisjointSet.cs.meta +11 -0
- package/Runtime/Core/DataStructure/Heap.cs +514 -0
- package/Runtime/Core/DataStructure/Heap.cs.meta +11 -0
- package/Runtime/Core/DataStructure/{ISpatialTree.cs → ISpatialTree2D.cs} +25 -21
- package/Runtime/Core/DataStructure/ISpatialTree2D.cs.meta +11 -0
- package/Runtime/Core/DataStructure/ISpatialTree3D.cs +33 -0
- package/Runtime/Core/DataStructure/ISpatialTree3D.cs.meta +11 -0
- package/Runtime/Core/DataStructure/ImmutableBitSet.cs +398 -0
- package/Runtime/Core/DataStructure/ImmutableBitSet.cs.meta +3 -0
- package/Runtime/Core/DataStructure/KDTree2D.cs +852 -0
- package/Runtime/Core/DataStructure/KDTree2D.cs.meta +11 -0
- package/Runtime/Core/DataStructure/KDTree3D.cs +911 -0
- package/Runtime/Core/DataStructure/KDTree3D.cs.meta +11 -0
- package/Runtime/Core/DataStructure/OctTree3D.cs +983 -0
- package/Runtime/Core/DataStructure/OctTree3D.cs.meta +11 -0
- package/Runtime/Core/DataStructure/PriorityQueue.cs +194 -0
- package/Runtime/Core/DataStructure/PriorityQueue.cs.meta +11 -0
- package/Runtime/Core/DataStructure/QuadTree2D.cs +722 -0
- package/Runtime/Core/DataStructure/QuadTree2D.cs.meta +11 -0
- package/Runtime/Core/DataStructure/RTree2D.cs +704 -0
- package/Runtime/Core/DataStructure/{RTree.cs.meta → RTree2D.cs.meta} +11 -11
- package/Runtime/Core/DataStructure/RTree3D.cs +775 -0
- package/Runtime/Core/DataStructure/RTree3D.cs.meta +11 -0
- package/Runtime/Core/DataStructure/SparseSet.cs +597 -0
- package/Runtime/Core/DataStructure/SparseSet.cs.meta +11 -0
- package/Runtime/Core/DataStructure/SpatialHash2D.cs +312 -0
- package/Runtime/Core/DataStructure/SpatialHash2D.cs.meta +3 -0
- package/Runtime/Core/DataStructure/SpatialHash3D.cs +341 -0
- package/Runtime/Core/DataStructure/SpatialHash3D.cs.meta +11 -0
- package/Runtime/Core/DataStructure/Sphere.cs +264 -0
- package/Runtime/Core/DataStructure/Sphere.cs.meta +11 -0
- package/Runtime/Core/DataStructure/StringWrapper.cs +115 -91
- package/Runtime/Core/DataStructure/StringWrapper.cs.meta +11 -11
- package/Runtime/Core/DataStructure/TimedCache.cs +88 -66
- package/Runtime/Core/DataStructure/TimedCache.cs.meta +11 -11
- package/Runtime/Core/DataStructure/Trie.cs +660 -359
- package/Runtime/Core/DataStructure/Trie.cs.meta +2 -2
- package/Runtime/Core/DataStructure.meta +8 -8
- package/Runtime/Core/Extension/AnimatorExtensions.cs +40 -25
- package/Runtime/Core/Extension/AnimatorExtensions.cs.meta +11 -11
- package/Runtime/Core/Extension/AsyncOperationExtensions.cs +404 -110
- package/Runtime/Core/Extension/AsyncOperationExtensions.cs.meta +2 -2
- package/Runtime/Core/Extension/CircleExtensions.cs +125 -25
- package/Runtime/Core/Extension/CircleExtensions.cs.meta +11 -11
- package/Runtime/Core/Extension/ColorExtensions.cs +983 -644
- package/Runtime/Core/Extension/ColorExtensions.cs.meta +11 -11
- package/Runtime/Core/Extension/DictionaryExtensions.cs +606 -299
- package/Runtime/Core/Extension/DictionaryExtensions.cs.meta +11 -11
- package/Runtime/Core/Extension/DirectionExtensions.cs +377 -213
- package/Runtime/Core/Extension/DirectionExtensions.cs.meta +11 -11
- package/Runtime/Core/Extension/EnumExtensions.cs +535 -137
- package/Runtime/Core/Extension/EnumExtensions.cs.meta +2 -2
- package/Runtime/Core/Extension/IEnumerableExtensions.cs +341 -124
- package/Runtime/Core/Extension/IEnumerableExtensions.cs.meta +11 -11
- package/Runtime/Core/Extension/IListExtensions.cs +767 -248
- package/Runtime/Core/Extension/IListExtensions.cs.meta +11 -11
- package/Runtime/Core/Extension/IReadonlyListExtensions.cs +687 -37
- package/Runtime/Core/Extension/IReadonlyListExtensions.cs.meta +2 -2
- package/Runtime/Core/Extension/ProtoEqualityExtensions.cs +292 -0
- package/Runtime/Core/Extension/ProtoEqualityExtensions.cs.meta +3 -0
- package/Runtime/Core/Extension/RandomExtensions.cs +938 -109
- package/Runtime/Core/Extension/RandomExtensions.cs.meta +11 -11
- package/Runtime/Core/Extension/StringExtensions.cs +1635 -239
- package/Runtime/Core/Extension/StringExtensions.cs.meta +11 -11
- package/Runtime/Core/Extension/UnityExtensions.cs +4555 -1689
- package/Runtime/Core/Extension/UnityExtensions.cs.meta +11 -11
- package/Runtime/Core/Extension/WallstopStudiosLogger.cs +271 -245
- package/Runtime/Core/Extension/WallstopStudiosLogger.cs.meta +11 -11
- package/Runtime/Core/Extension.meta +8 -8
- package/Runtime/Core/Helper/ArrayConverter.cs +73 -39
- package/Runtime/Core/Helper/ArrayConverter.cs.meta +2 -2
- package/Runtime/Core/Helper/AssignUtilities.cs +33 -14
- package/Runtime/Core/Helper/AssignUtilities.cs.meta +11 -11
- package/Runtime/Core/Helper/DirectoryHelper.cs +210 -196
- package/Runtime/Core/Helper/DirectoryHelper.cs.meta +2 -2
- package/Runtime/Core/Helper/Enumerables.cs +51 -17
- package/Runtime/Core/Helper/Enumerables.cs.meta +11 -11
- package/Runtime/Core/Helper/FileHelper.cs +97 -77
- package/Runtime/Core/Helper/FileHelper.cs.meta +2 -2
- package/Runtime/Core/Helper/FormattingHelpers.cs +49 -38
- package/Runtime/Core/Helper/FormattingHelpers.cs.meta +2 -2
- package/Runtime/Core/Helper/FuncBasedComparer.cs +29 -0
- package/Runtime/Core/Helper/FuncBasedComparer.cs.meta +3 -0
- package/Runtime/Core/Helper/Geometry.cs +65 -43
- package/Runtime/Core/Helper/Geometry.cs.meta +11 -11
- package/Runtime/Core/Helper/Helpers.cs +1271 -831
- package/Runtime/Core/Helper/Helpers.cs.meta +11 -11
- package/Runtime/Core/Helper/IterationHelpers.cs +83 -32
- package/Runtime/Core/Helper/IterationHelpers.cs.meta +11 -11
- package/Runtime/Core/Helper/LifetimeHelpers.cs +20 -13
- package/Runtime/Core/Helper/LifetimeHelpers.cs.meta +11 -11
- package/Runtime/Core/Helper/LineHelper.cs +259 -194
- package/Runtime/Core/Helper/LineHelper.cs.meta +2 -2
- package/Runtime/Core/Helper/Logging/UnityLogTagFormatter.cs +549 -539
- package/Runtime/Core/Helper/Logging/UnityLogTagFormatter.cs.meta +2 -2
- package/Runtime/Core/Helper/Logging.meta +2 -2
- package/Runtime/Core/Helper/Objects.cs +477 -769
- package/Runtime/Core/Helper/Objects.cs.meta +11 -11
- package/Runtime/Core/Helper/Partials/LogHelpers.cs +13 -13
- package/Runtime/Core/Helper/Partials/LogHelpers.cs.meta +2 -2
- package/Runtime/Core/Helper/Partials/MathHelpers.cs +45 -30
- package/Runtime/Core/Helper/Partials/MathHelpers.cs.meta +2 -2
- package/Runtime/Core/Helper/Partials/ObjectHelpers.cs +506 -400
- package/Runtime/Core/Helper/Partials/ObjectHelpers.cs.meta +2 -2
- package/Runtime/Core/Helper/Partials/TransformHelpers.cs +393 -377
- package/Runtime/Core/Helper/Partials/TransformHelpers.cs.meta +2 -2
- package/Runtime/Core/Helper/Partials.meta +2 -2
- package/Runtime/Core/Helper/PathHelper.cs +42 -15
- package/Runtime/Core/Helper/PathHelper.cs.meta +2 -2
- package/Runtime/Core/Helper/ReflectionHelpers.cs +5287 -1963
- package/Runtime/Core/Helper/ReflectionHelpers.cs.meta +2 -2
- package/Runtime/Core/Helper/ReverseComparer.cs +33 -0
- package/Runtime/Core/Helper/ReverseComparer.cs.meta +3 -0
- package/Runtime/Core/Helper/SceneHelper.cs +251 -224
- package/Runtime/Core/Helper/SceneHelper.cs.meta +2 -2
- package/Runtime/Core/Helper/SpriteHelpers.cs +50 -41
- package/Runtime/Core/Helper/SpriteHelpers.cs.meta +11 -11
- package/Runtime/Core/Helper/StringInList.cs +61 -35
- package/Runtime/Core/Helper/StringInList.cs.meta +11 -11
- package/Runtime/Core/Helper/TestAssemblyHelper.cs +134 -0
- package/Runtime/Core/Helper/TestAssemblyHelper.cs.meta +11 -0
- package/Runtime/Core/Helper/UnityMainThreadDispatcher.cs +100 -82
- package/Runtime/Core/Helper/UnityMainThreadDispatcher.cs.meta +2 -2
- package/Runtime/Core/Helper/WallMath.cs +672 -166
- package/Runtime/Core/Helper/WallMath.cs.meta +11 -11
- package/Runtime/Core/Helper.meta +8 -8
- package/Runtime/Core/Math/Line2D.cs +263 -0
- package/Runtime/Core/Math/Line2D.cs.meta +11 -0
- package/Runtime/Core/Math/Line3D.cs +452 -0
- package/Runtime/Core/Math/Line3D.cs.meta +11 -0
- package/Runtime/Core/Math/Parabola.cs +241 -47
- package/Runtime/Core/Math/Parabola.cs.meta +11 -11
- package/Runtime/Core/Math/PointPolygonCheck.cs +175 -36
- package/Runtime/Core/Math/PointPolygonCheck.cs.meta +11 -11
- package/Runtime/Core/Math/Range.cs +157 -92
- package/Runtime/Core/Math/Range.cs.meta +11 -11
- package/Runtime/Core/Math.meta +8 -8
- package/Runtime/Core/Model/Direction.cs +25 -43
- package/Runtime/Core/Model/Direction.cs.meta +11 -11
- package/Runtime/Core/Model.meta +8 -8
- package/Runtime/Core/OneOf/FastOneOf.cs +252 -152
- package/Runtime/Core/OneOf/FastOneOf.cs.meta +11 -11
- package/Runtime/Core/OneOf/FastOneOf2.cs +198 -0
- package/Runtime/Core/OneOf/FastOneOf2.cs.meta +11 -0
- package/Runtime/Core/OneOf/FastOneOf4.cs +324 -0
- package/Runtime/Core/OneOf/FastOneOf4.cs.meta +11 -0
- package/Runtime/Core/OneOf/None.cs +30 -4
- package/Runtime/Core/OneOf/None.cs.meta +11 -11
- package/Runtime/Core/OneOf.meta +8 -8
- package/Runtime/Core/Random/AbstractRandom.cs +1318 -655
- package/Runtime/Core/Random/AbstractRandom.cs.meta +11 -11
- package/Runtime/Core/Random/DotNetRandom.cs +118 -54
- package/Runtime/Core/Random/DotNetRandom.cs.meta +2 -2
- package/Runtime/Core/Random/IRandom.cs +203 -161
- package/Runtime/Core/Random/IRandom.cs.meta +11 -11
- package/Runtime/Core/Random/IllusionFlow.cs +171 -107
- package/Runtime/Core/Random/IllusionFlow.cs.meta +2 -2
- package/Runtime/Core/Random/LinearCongruentialGenerator.cs +90 -49
- package/Runtime/Core/Random/LinearCongruentialGenerator.cs.meta +2 -2
- package/Runtime/Core/Random/NativePcgRandom.cs +139 -97
- package/Runtime/Core/Random/NativePcgRandom.cs.meta +11 -11
- package/Runtime/Core/Random/PRNG.cs +21 -7
- package/Runtime/Core/Random/PRNG.cs.meta +2 -2
- package/Runtime/Core/Random/PcgRandom.cs +243 -149
- package/Runtime/Core/Random/PcgRandom.cs.meta +11 -11
- package/Runtime/Core/Random/PerlinNoise.cs +369 -369
- package/Runtime/Core/Random/PerlinNoise.cs.meta +2 -2
- package/Runtime/Core/Random/RandomComparer.cs +34 -0
- package/Runtime/Core/Random/RandomComparer.cs.meta +3 -0
- package/Runtime/Core/Random/RandomState.cs +206 -131
- package/Runtime/Core/Random/RandomState.cs.meta +11 -11
- package/Runtime/Core/Random/RandomUtilities.cs +55 -26
- package/Runtime/Core/Random/RandomUtilities.cs.meta +11 -11
- package/Runtime/Core/Random/RomuDuo.cs +171 -116
- package/Runtime/Core/Random/RomuDuo.cs.meta +2 -2
- package/Runtime/Core/Random/SplitMix64.cs +134 -94
- package/Runtime/Core/Random/SplitMix64.cs.meta +2 -2
- package/Runtime/Core/Random/SquirrelRandom.cs +127 -84
- package/Runtime/Core/Random/SquirrelRandom.cs.meta +11 -11
- package/Runtime/Core/Random/SystemRandom.cs +203 -162
- package/Runtime/Core/Random/SystemRandom.cs.meta +11 -11
- package/Runtime/Core/Random/ThreadLocalRandom.cs +25 -12
- package/Runtime/Core/Random/ThreadLocalRandom.cs.meta +11 -11
- package/Runtime/Core/Random/UnityRandom.cs +109 -57
- package/Runtime/Core/Random/UnityRandom.cs.meta +11 -11
- package/Runtime/Core/Random/WyRandom.cs +158 -121
- package/Runtime/Core/Random/WyRandom.cs.meta +2 -2
- package/Runtime/Core/Random/XorShiftRandom.cs +106 -52
- package/Runtime/Core/Random/XorShiftRandom.cs.meta +11 -11
- package/Runtime/Core/Random/XoroShiroRandom.cs +184 -119
- package/Runtime/Core/Random/XoroShiroRandom.cs.meta +2 -2
- package/Runtime/Core/Random.meta +8 -8
- package/Runtime/Core/Serialization/JsonConverters/AnimationCurveConverter.cs +248 -0
- package/Runtime/Core/Serialization/JsonConverters/AnimationCurveConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/BitSetConverter.cs +119 -0
- package/Runtime/Core/Serialization/JsonConverters/BitSetConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/BoundingSphereConverter.cs +74 -0
- package/Runtime/Core/Serialization/JsonConverters/BoundingSphereConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/BoundsConverter.cs +132 -0
- package/Runtime/Core/Serialization/JsonConverters/BoundsConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/BoundsIntConverter.cs +135 -0
- package/Runtime/Core/Serialization/JsonConverters/BoundsIntConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/Color32Converter.cs +98 -0
- package/Runtime/Core/Serialization/JsonConverters/Color32Converter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/ColorBlockConverter.cs +123 -0
- package/Runtime/Core/Serialization/JsonConverters/ColorBlockConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/ColorConverter.cs +88 -88
- package/Runtime/Core/Serialization/JsonConverters/ColorConverter.cs.meta +2 -2
- package/Runtime/Core/Serialization/JsonConverters/CyclicBufferConverterFactory.cs +112 -0
- package/Runtime/Core/Serialization/JsonConverters/CyclicBufferConverterFactory.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/DequeConverterFactory.cs +62 -0
- package/Runtime/Core/Serialization/JsonConverters/DequeConverterFactory.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/FastVector2IntConverter.cs +72 -0
- package/Runtime/Core/Serialization/JsonConverters/FastVector2IntConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/FastVector3IntConverter.cs +80 -0
- package/Runtime/Core/Serialization/JsonConverters/FastVector3IntConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/GameObjectConverter.cs +36 -36
- package/Runtime/Core/Serialization/JsonConverters/GameObjectConverter.cs.meta +2 -2
- package/Runtime/Core/Serialization/JsonConverters/GradientConverter.cs +245 -0
- package/Runtime/Core/Serialization/JsonConverters/GradientConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/Hash128Converter.cs +92 -0
- package/Runtime/Core/Serialization/JsonConverters/Hash128Converter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/ImmutableBitSetConverter.cs +119 -0
- package/Runtime/Core/Serialization/JsonConverters/ImmutableBitSetConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/KVector2Converter.cs +72 -0
- package/Runtime/Core/Serialization/JsonConverters/KVector2Converter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/LayerMaskConverter.cs +95 -0
- package/Runtime/Core/Serialization/JsonConverters/LayerMaskConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/Matrix4x4Converter.cs +237 -218
- package/Runtime/Core/Serialization/JsonConverters/Matrix4x4Converter.cs.meta +2 -2
- package/Runtime/Core/Serialization/JsonConverters/MinMaxCurveConverter.cs +142 -0
- package/Runtime/Core/Serialization/JsonConverters/MinMaxCurveConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/MinMaxGradientConverter.cs +135 -0
- package/Runtime/Core/Serialization/JsonConverters/MinMaxGradientConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/PlaneConverter.cs +79 -0
- package/Runtime/Core/Serialization/JsonConverters/PlaneConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/PoseConverter.cs +76 -0
- package/Runtime/Core/Serialization/JsonConverters/PoseConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/QuaternionConverter.cs +88 -0
- package/Runtime/Core/Serialization/JsonConverters/QuaternionConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/RangeConverterFactory.cs +106 -0
- package/Runtime/Core/Serialization/JsonConverters/RangeConverterFactory.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/RangeIntConverter.cs +71 -0
- package/Runtime/Core/Serialization/JsonConverters/RangeIntConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/Ray2DConverter.cs +80 -0
- package/Runtime/Core/Serialization/JsonConverters/Ray2DConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/RayConverter.cs +76 -0
- package/Runtime/Core/Serialization/JsonConverters/RayConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/RaycastHitConverter.cs +115 -0
- package/Runtime/Core/Serialization/JsonConverters/RaycastHitConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/RectConverter.cs +84 -0
- package/Runtime/Core/Serialization/JsonConverters/RectConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/RectIntConverter.cs +88 -0
- package/Runtime/Core/Serialization/JsonConverters/RectIntConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/RectOffsetConverter.cs +87 -0
- package/Runtime/Core/Serialization/JsonConverters/RectOffsetConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/RenderTextureDescriptorConverter.cs +264 -0
- package/Runtime/Core/Serialization/JsonConverters/RenderTextureDescriptorConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/ResolutionConverter.cs +158 -0
- package/Runtime/Core/Serialization/JsonConverters/ResolutionConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/SceneConverter.cs +103 -0
- package/Runtime/Core/Serialization/JsonConverters/SceneConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/SphericalHarmonicsL2Converter.cs +121 -0
- package/Runtime/Core/Serialization/JsonConverters/SphericalHarmonicsL2Converter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/TouchConverter.cs +54 -0
- package/Runtime/Core/Serialization/JsonConverters/TouchConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/TypeConverter.cs +30 -28
- package/Runtime/Core/Serialization/JsonConverters/TypeConverter.cs.meta +2 -2
- package/Runtime/Core/Serialization/JsonConverters/Vector2Converter.cs +72 -74
- package/Runtime/Core/Serialization/JsonConverters/Vector2Converter.cs.meta +11 -11
- package/Runtime/Core/Serialization/JsonConverters/Vector2IntConverter.cs +72 -0
- package/Runtime/Core/Serialization/JsonConverters/Vector2IntConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/Vector3Converter.cs +80 -81
- package/Runtime/Core/Serialization/JsonConverters/Vector3Converter.cs.meta +11 -11
- package/Runtime/Core/Serialization/JsonConverters/Vector3IntConverter.cs +80 -0
- package/Runtime/Core/Serialization/JsonConverters/Vector3IntConverter.cs.meta +11 -0
- package/Runtime/Core/Serialization/JsonConverters/Vector4Converter.cs +88 -88
- package/Runtime/Core/Serialization/JsonConverters/Vector4Converter.cs.meta +2 -2
- package/Runtime/Core/Serialization/JsonConverters.meta +8 -8
- package/Runtime/Core/Serialization/ProtobufUnitySurrogates.cs +383 -0
- package/Runtime/Core/Serialization/ProtobufUnitySurrogates.cs.meta +11 -0
- package/Runtime/Core/Serialization/Serializer.cs +2020 -195
- package/Runtime/Core/Serialization/Serializer.cs.meta +11 -11
- package/Runtime/Core/Serialization.meta +8 -8
- package/Runtime/Core/Threading/SingleThreadedThreadPool.cs +228 -228
- package/Runtime/Core/Threading/SingleThreadedThreadPool.cs.meta +11 -11
- package/Runtime/Core/Threading.meta +8 -8
- package/Runtime/Core.meta +8 -8
- package/Runtime/Integrations/VContainer/ObjectResolverRelationalExtensions.cs +185 -0
- package/Runtime/Integrations/VContainer/ObjectResolverRelationalExtensions.cs.meta +11 -0
- package/Runtime/Integrations/VContainer/RelationalComponentEntryPoint.cs +109 -0
- package/Runtime/Integrations/VContainer/RelationalComponentEntryPoint.cs.meta +11 -0
- package/Runtime/Integrations/VContainer/RelationalComponentsBuilderExtensions.cs +78 -0
- package/Runtime/Integrations/VContainer/RelationalComponentsBuilderExtensions.cs.meta +11 -0
- package/Runtime/Integrations/VContainer/RelationalSceneAssignmentOptions.cs +83 -0
- package/Runtime/Integrations/VContainer/RelationalSceneAssignmentOptions.cs.meta +11 -0
- package/Runtime/Integrations/VContainer/WallstopStudios.UnityHelpers.Integration.VContainer.asmdef +30 -0
- package/Runtime/Integrations/VContainer/WallstopStudios.UnityHelpers.Integration.VContainer.asmdef.meta +7 -0
- package/Runtime/Integrations/VContainer.meta +8 -0
- package/Runtime/Integrations/Zenject/DiContainerRelationalExtensions.cs +180 -0
- package/Runtime/Integrations/Zenject/DiContainerRelationalExtensions.cs.meta +11 -0
- package/Runtime/Integrations/Zenject/RelationalComponentSceneInitializer.cs +105 -0
- package/Runtime/Integrations/Zenject/RelationalComponentSceneInitializer.cs.meta +11 -0
- package/Runtime/Integrations/Zenject/RelationalComponentsInstaller.cs +72 -0
- package/Runtime/Integrations/Zenject/RelationalComponentsInstaller.cs.meta +11 -0
- package/Runtime/Integrations/Zenject/RelationalSceneAssignmentOptions.cs +87 -0
- package/Runtime/Integrations/Zenject/RelationalSceneAssignmentOptions.cs.meta +11 -0
- package/Runtime/Integrations/Zenject/WallstopStudios.UnityHelpers.Integration.Zenject.asmdef +30 -0
- package/Runtime/Integrations/Zenject/WallstopStudios.UnityHelpers.Integration.Zenject.asmdef.meta +7 -0
- package/Runtime/Integrations/Zenject.meta +8 -0
- package/Runtime/Integrations.meta +8 -0
- package/Runtime/Protobuf-Net/System.Collections.Immutable.dll.meta +33 -33
- package/Runtime/Protobuf-Net/System.Runtime.CompilerServices.Unsafe.dll.meta +33 -33
- package/Runtime/Protobuf-Net/protobuf-net.Core.dll.meta +33 -33
- package/Runtime/Protobuf-Net/protobuf-net.dll.meta +33 -33
- package/Runtime/Protobuf-Net.meta +8 -8
- package/Runtime/Tags/AlwaysIncludeInAttributeMetadataCacheAttribute.cs +11 -0
- package/Runtime/Tags/AlwaysIncludeInAttributeMetadataCacheAttribute.cs.meta +11 -0
- package/Runtime/Tags/Attribute.cs +399 -205
- package/Runtime/Tags/Attribute.cs.meta +2 -2
- package/Runtime/Tags/AttributeEffect.cs +372 -281
- package/Runtime/Tags/AttributeEffect.cs.meta +2 -2
- package/Runtime/Tags/AttributeMetadataCache.cs +503 -0
- package/Runtime/Tags/AttributeMetadataCache.cs.meta +11 -0
- package/Runtime/Tags/AttributeMetadataFilters.cs +108 -0
- package/Runtime/Tags/AttributeMetadataFilters.cs.meta +11 -0
- package/Runtime/Tags/AttributeModification.cs +132 -48
- package/Runtime/Tags/AttributeModification.cs.meta +2 -2
- package/Runtime/Tags/AttributeUtilities.cs +376 -209
- package/Runtime/Tags/AttributeUtilities.cs.meta +2 -2
- package/Runtime/Tags/AttributesComponent.cs +237 -163
- package/Runtime/Tags/AttributesComponent.cs.meta +2 -2
- package/Runtime/Tags/CollisionSenses.cs +117 -91
- package/Runtime/Tags/CollisionSenses.cs.meta +2 -2
- package/Runtime/Tags/CosmeticEffectComponent.cs +112 -50
- package/Runtime/Tags/CosmeticEffectComponent.cs.meta +2 -2
- package/Runtime/Tags/CosmeticEffectData.cs +109 -63
- package/Runtime/Tags/CosmeticEffectData.cs.meta +2 -2
- package/Runtime/Tags/EffectHandle.cs +150 -65
- package/Runtime/Tags/EffectHandle.cs.meta +2 -2
- package/Runtime/Tags/EffectHandler.cs +470 -393
- package/Runtime/Tags/EffectHandler.cs.meta +2 -2
- package/Runtime/Tags/ModificationAction.cs +60 -9
- package/Runtime/Tags/ModificationAction.cs.meta +2 -2
- package/Runtime/Tags/ModifierDurationType.cs +71 -13
- package/Runtime/Tags/ModifierDurationType.cs.meta +2 -2
- package/Runtime/Tags/TagHandler.cs +373 -158
- package/Runtime/Tags/TagHandler.cs.meta +2 -2
- package/Runtime/Tags.meta +2 -2
- package/Runtime/Utils/AnimationEventEqualityComparer.cs +198 -161
- package/Runtime/Utils/AnimationEventEqualityComparer.cs.meta +11 -11
- package/Runtime/Utils/AnimatorEnumStateMachine.cs +110 -88
- package/Runtime/Utils/AnimatorEnumStateMachine.cs.meta +11 -11
- package/Runtime/Utils/Ascii85.cs +132 -115
- package/Runtime/Utils/Ascii85.cs.meta +2 -2
- package/Runtime/Utils/Buffers.cs +1151 -550
- package/Runtime/Utils/Buffers.cs.meta +11 -11
- package/Runtime/Utils/CenterPointOffset.cs +35 -30
- package/Runtime/Utils/CenterPointOffset.cs.meta +2 -2
- package/Runtime/Utils/ChildSpawner.cs +250 -157
- package/Runtime/Utils/ChildSpawner.cs.meta +2 -2
- package/Runtime/Utils/CircleLineRenderer.cs +142 -142
- package/Runtime/Utils/CircleLineRenderer.cs.meta +11 -11
- package/Runtime/Utils/CollisionProxy.cs +48 -48
- package/Runtime/Utils/CollisionProxy.cs.meta +2 -2
- package/Runtime/Utils/CoroutineHandler.cs +4 -4
- package/Runtime/Utils/CoroutineHandler.cs.meta +2 -2
- package/Runtime/Utils/DeferredDisposalResult.cs +20 -23
- package/Runtime/Utils/DeferredDisposalResult.cs.meta +2 -2
- package/Runtime/Utils/LZMA.cs +276 -53
- package/Runtime/Utils/LZMA.cs.meta +2 -2
- package/Runtime/Utils/MatchColliderToSprite.cs +104 -104
- package/Runtime/Utils/MatchColliderToSprite.cs.meta +2 -2
- package/Runtime/Utils/MatchTransform.cs +99 -82
- package/Runtime/Utils/MatchTransform.cs.meta +2 -2
- package/Runtime/Utils/Oscillator.cs +27 -27
- package/Runtime/Utils/Oscillator.cs.meta +11 -11
- package/Runtime/Utils/PolygonCollider2DOptimizer.cs +104 -83
- package/Runtime/Utils/PolygonCollider2DOptimizer.cs.meta +2 -2
- package/Runtime/Utils/RuntimeSingleton.cs +139 -88
- package/Runtime/Utils/RuntimeSingleton.cs.meta +11 -11
- package/Runtime/Utils/ScriptableObjectSingleton.cs +226 -85
- package/Runtime/Utils/ScriptableObjectSingleton.cs.meta +2 -2
- package/Runtime/Utils/SerializedStringComparer.cs +107 -107
- package/Runtime/Utils/SerializedStringComparer.cs.meta +2 -2
- package/Runtime/Utils/SetTextureImportData.cs +69 -69
- package/Runtime/Utils/SetTextureImportData.cs.meta +11 -11
- package/Runtime/Utils/SevenZip/Common/CRC.cs +70 -70
- package/Runtime/Utils/SevenZip/Common/CRC.cs.meta +11 -11
- package/Runtime/Utils/SevenZip/Common/InBuffer.cs +84 -84
- package/Runtime/Utils/SevenZip/Common/InBuffer.cs.meta +11 -11
- package/Runtime/Utils/SevenZip/Common/OutBuffer.cs +70 -70
- package/Runtime/Utils/SevenZip/Common/OutBuffer.cs.meta +11 -11
- package/Runtime/Utils/SevenZip/Common.meta +2 -2
- package/Runtime/Utils/SevenZip/Compress/LZ/IMatchFinder.cs +28 -28
- package/Runtime/Utils/SevenZip/Compress/LZ/IMatchFinder.cs.meta +11 -11
- package/Runtime/Utils/SevenZip/Compress/LZ/LzBinTree.cs +454 -454
- package/Runtime/Utils/SevenZip/Compress/LZ/LzBinTree.cs.meta +11 -11
- package/Runtime/Utils/SevenZip/Compress/LZ/LzInWindow.cs +179 -179
- package/Runtime/Utils/SevenZip/Compress/LZ/LzInWindow.cs.meta +11 -11
- package/Runtime/Utils/SevenZip/Compress/LZ/LzOutWindow.cs +137 -137
- package/Runtime/Utils/SevenZip/Compress/LZ/LzOutWindow.cs.meta +11 -11
- package/Runtime/Utils/SevenZip/Compress/LZ.meta +8 -8
- package/Runtime/Utils/SevenZip/Compress/LZMA/LzmaBase.cs +110 -110
- package/Runtime/Utils/SevenZip/Compress/LZMA/LzmaBase.cs.meta +11 -11
- package/Runtime/Utils/SevenZip/Compress/LZMA/LzmaDecoder.cs +525 -527
- package/Runtime/Utils/SevenZip/Compress/LZMA/LzmaDecoder.cs.meta +11 -11
- package/Runtime/Utils/SevenZip/Compress/LZMA/LzmaEncoder.cs +1891 -1904
- package/Runtime/Utils/SevenZip/Compress/LZMA/LzmaEncoder.cs.meta +11 -11
- package/Runtime/Utils/SevenZip/Compress/LZMA.meta +8 -8
- package/Runtime/Utils/SevenZip/Compress/RangeCoder/RangeCoder.cs +242 -242
- package/Runtime/Utils/SevenZip/Compress/RangeCoder/RangeCoder.cs.meta +11 -11
- package/Runtime/Utils/SevenZip/Compress/RangeCoder/RangeCoderBit.cs +146 -149
- package/Runtime/Utils/SevenZip/Compress/RangeCoder/RangeCoderBit.cs.meta +11 -11
- package/Runtime/Utils/SevenZip/Compress/RangeCoder/RangeCoderBitTree.cs +177 -177
- package/Runtime/Utils/SevenZip/Compress/RangeCoder/RangeCoderBitTree.cs.meta +11 -11
- package/Runtime/Utils/SevenZip/Compress/RangeCoder.meta +8 -8
- package/Runtime/Utils/SevenZip/Compress.meta +8 -8
- package/Runtime/Utils/SevenZip/ICoder.cs +177 -177
- package/Runtime/Utils/SevenZip/ICoder.cs.meta +11 -11
- package/Runtime/Utils/SevenZip.meta +2 -2
- package/Runtime/Utils/SpriteRendererMetadata.cs +346 -370
- package/Runtime/Utils/SpriteRendererMetadata.cs.meta +2 -2
- package/Runtime/Utils/SpriteRendererSyncer.cs +100 -100
- package/Runtime/Utils/SpriteRendererSyncer.cs.meta +2 -2
- package/Runtime/Utils/StartTracker.cs +15 -15
- package/Runtime/Utils/StartTracker.cs.meta +2 -2
- package/Runtime/Utils/TextureScale.cs +356 -179
- package/Runtime/Utils/TextureScale.cs.meta +2 -2
- package/Runtime/Utils/TypeNameSorter.cs +17 -17
- package/Runtime/Utils/TypeNameSorter.cs.meta +2 -2
- package/Runtime/Utils/UnityObjectNameComparer.cs +89 -89
- package/Runtime/Utils/UnityObjectNameComparer.cs.meta +2 -2
- package/Runtime/Utils.meta +8 -8
- package/Runtime/Visuals/AnimatedSpriteLayer.cs +217 -130
- package/Runtime/Visuals/AnimatedSpriteLayer.cs.meta +2 -2
- package/Runtime/Visuals/UGUI/EnhancedImage.cs +218 -85
- package/Runtime/Visuals/UGUI/EnhancedImage.cs.meta +2 -2
- package/Runtime/Visuals/UGUI.meta +2 -2
- package/Runtime/Visuals/UIToolkit/LayeredImage.cs +781 -484
- package/Runtime/Visuals/UIToolkit/LayeredImage.cs.meta +2 -2
- package/Runtime/Visuals/UIToolkit/MultiFileSelectorElement.cs +945 -322
- package/Runtime/Visuals/UIToolkit/MultiFileSelectorElement.cs.meta +2 -2
- package/Runtime/Visuals/UIToolkit.meta +2 -2
- package/Runtime/Visuals.meta +2 -2
- package/Runtime/WallstopStudios.UnityHelpers.asmdef +22 -14
- package/Runtime/WallstopStudios.UnityHelpers.asmdef.meta +7 -7
- package/Runtime.meta +8 -8
- package/SERIALIZATION.md +648 -0
- package/SERIALIZATION.md.meta +7 -0
- package/SINGLETONS.md +427 -0
- package/SINGLETONS.md.meta +7 -0
- package/SPATIAL_TREES_2D_GUIDE.md +261 -0
- package/SPATIAL_TREES_2D_GUIDE.md.meta +7 -0
- package/SPATIAL_TREES_3D_GUIDE.md +214 -0
- package/SPATIAL_TREES_3D_GUIDE.md.meta +7 -0
- package/SPATIAL_TREE_2D_PERFORMANCE.md +238 -0
- package/SPATIAL_TREE_2D_PERFORMANCE.md.meta +7 -0
- package/SPATIAL_TREE_3D_PERFORMANCE.md +240 -0
- package/SPATIAL_TREE_3D_PERFORMANCE.md.meta +7 -0
- package/SPATIAL_TREE_SEMANTICS.md +106 -0
- package/SPATIAL_TREE_SEMANTICS.md.meta +7 -0
- package/Samples~/DI - VContainer/Prefabs/RelationalConsumer.prefab +77 -0
- package/Samples~/DI - VContainer/Prefabs/RelationalConsumer.prefab.meta +8 -0
- package/Samples~/DI - VContainer/Prefabs/Spawner.prefab +47 -0
- package/Samples~/DI - VContainer/Prefabs/Spawner.prefab.meta +8 -0
- package/Samples~/DI - VContainer/Prefabs.meta +9 -0
- package/Samples~/DI - VContainer/README.md +334 -0
- package/Samples~/DI - VContainer/README.md.meta +8 -0
- package/Samples~/DI - VContainer/Scenes/VContainer_Sample.unity +120 -0
- package/Samples~/DI - VContainer/Scenes/VContainer_Sample.unity.meta +8 -0
- package/Samples~/DI - VContainer/Scenes.meta +9 -0
- package/Samples~/DI - VContainer/Scripts/GameLifetimeScope.cs +24 -0
- package/Samples~/DI - VContainer/Scripts/GameLifetimeScope.cs.meta +12 -0
- package/Samples~/DI - VContainer/Scripts/RelationalConsumer.cs +21 -0
- package/Samples~/DI - VContainer/Scripts/RelationalConsumer.cs.meta +12 -0
- package/Samples~/DI - VContainer/Scripts/Samples.UnityHelpers.DI.VContainer.asmdef +37 -0
- package/Samples~/DI - VContainer/Scripts/Samples.UnityHelpers.DI.VContainer.asmdef.meta +8 -0
- package/Samples~/DI - VContainer/Scripts/Spawner.cs +21 -0
- package/Samples~/DI - VContainer/Scripts/Spawner.cs.meta +12 -0
- package/Samples~/DI - VContainer/Scripts.meta +9 -0
- package/Samples~/DI - VContainer.meta +9 -0
- package/Samples~/DI - Zenject/Prefabs/RelationalConsumer.prefab +77 -0
- package/Samples~/DI - Zenject/Prefabs/RelationalConsumer.prefab.meta +8 -0
- package/Samples~/DI - Zenject/Prefabs/SpawnerZenject.prefab +47 -0
- package/Samples~/DI - Zenject/Prefabs/SpawnerZenject.prefab.meta +8 -0
- package/Samples~/DI - Zenject/Prefabs.meta +9 -0
- package/Samples~/DI - Zenject/README.md +389 -0
- package/Samples~/DI - Zenject/README.md.meta +7 -0
- package/Samples~/DI - Zenject/Scenes/Zenject_Sample.unity +164 -0
- package/Samples~/DI - Zenject/Scenes/Zenject_Sample.unity.meta +8 -0
- package/Samples~/DI - Zenject/Scenes.meta +9 -0
- package/Samples~/DI - Zenject/Scripts/RelationalConsumer.cs +19 -0
- package/Samples~/DI - Zenject/Scripts/RelationalConsumer.cs.meta +12 -0
- package/Samples~/DI - Zenject/Scripts/Samples.UnityHelpers.DI.Zenject.asmdef +36 -0
- package/Samples~/DI - Zenject/Scripts/Samples.UnityHelpers.DI.Zenject.asmdef.meta +8 -0
- package/Samples~/DI - Zenject/Scripts/SceneContextPlaceholder.cs +47 -0
- package/Samples~/DI - Zenject/Scripts/SceneContextPlaceholder.cs.meta +12 -0
- package/Samples~/DI - Zenject/Scripts/SpawnerZenject.cs +20 -0
- package/Samples~/DI - Zenject/Scripts/SpawnerZenject.cs.meta +12 -0
- package/Samples~/DI - Zenject/Scripts.meta +9 -0
- package/Samples~/DI - Zenject.meta +9 -0
- package/Samples~/Random - PRNG/README.md +12 -0
- package/Samples~/Random - PRNG/README.md.meta +8 -0
- package/Samples~/Random - PRNG/Scripts/RandomPrngDemo.cs +28 -0
- package/Samples~/Random - PRNG/Scripts/RandomPrngDemo.cs.meta +12 -0
- package/Samples~/Random - PRNG/Scripts/Samples.UnityHelpers.Random.Prng.asmdef +17 -0
- package/Samples~/Random - PRNG/Scripts/Samples.UnityHelpers.Random.Prng.asmdef.meta +8 -0
- package/Samples~/Random - PRNG/Scripts.meta +9 -0
- package/Samples~/Random - PRNG.meta +9 -0
- package/Samples~/Relational Components - Basic/README.md +19 -0
- package/Samples~/Relational Components - Basic/README.md.meta +8 -0
- package/Samples~/Relational Components - Basic/Scripts/RelationalBasicConsumer.cs +37 -0
- package/Samples~/Relational Components - Basic/Scripts/RelationalBasicConsumer.cs.meta +12 -0
- package/Samples~/Relational Components - Basic/Scripts/Samples.UnityHelpers.Relational.Basic.asmdef +17 -0
- package/Samples~/Relational Components - Basic/Scripts/Samples.UnityHelpers.Relational.Basic.asmdef.meta +8 -0
- package/Samples~/Relational Components - Basic/Scripts.meta +9 -0
- package/Samples~/Relational Components - Basic.meta +9 -0
- package/Samples~/Serialization - JSON/README.md +13 -0
- package/Samples~/Serialization - JSON/README.md.meta +8 -0
- package/Samples~/Serialization - JSON/Scripts/JsonSerializationDemo.cs +50 -0
- package/Samples~/Serialization - JSON/Scripts/JsonSerializationDemo.cs.meta +12 -0
- package/Samples~/Serialization - JSON/Scripts/Samples.UnityHelpers.Serialization.Json.asmdef +17 -0
- package/Samples~/Serialization - JSON/Scripts/Samples.UnityHelpers.Serialization.Json.asmdef.meta +8 -0
- package/Samples~/Serialization - JSON/Scripts.meta +9 -0
- package/Samples~/Serialization - JSON.meta +9 -0
- package/Samples~/Spatial Structures - 2D and 3D/README.md +13 -0
- package/Samples~/Spatial Structures - 2D and 3D/README.md.meta +8 -0
- package/Samples~/Spatial Structures - 2D and 3D/Scripts/Samples.UnityHelpers.SpatialStructures.asmdef +17 -0
- package/Samples~/Spatial Structures - 2D and 3D/Scripts/Samples.UnityHelpers.SpatialStructures.asmdef.meta +8 -0
- package/Samples~/Spatial Structures - 2D and 3D/Scripts/SpatialStructuresDemo.cs +62 -0
- package/Samples~/Spatial Structures - 2D and 3D/Scripts/SpatialStructuresDemo.cs.meta +12 -0
- package/Samples~/Spatial Structures - 2D and 3D/Scripts.meta +9 -0
- package/Samples~/Spatial Structures - 2D and 3D.meta +9 -0
- package/Samples~/UGUI - EnhancedImage/README.md +12 -0
- package/Samples~/UGUI - EnhancedImage/README.md.meta +8 -0
- package/Samples~/UGUI - EnhancedImage/Scripts/EnhancedImageDemo.cs +36 -0
- package/Samples~/UGUI - EnhancedImage/Scripts/EnhancedImageDemo.cs.meta +12 -0
- package/Samples~/UGUI - EnhancedImage/Scripts/Samples.UnityHelpers.UGUI.EnhancedImage.asmdef +17 -0
- package/Samples~/UGUI - EnhancedImage/Scripts/Samples.UnityHelpers.UGUI.EnhancedImage.asmdef.meta +8 -0
- package/Samples~/UGUI - EnhancedImage/Scripts.meta +9 -0
- package/Samples~/UGUI - EnhancedImage.meta +9 -0
- package/Samples~/UI Toolkit - MultiFile Selector (Editor)/README.md +12 -0
- package/Samples~/UI Toolkit - MultiFile Selector (Editor)/README.md.meta +8 -0
- package/Samples~/UI Toolkit - MultiFile Selector (Editor)/Scripts/Editor/MultiFileSelectorSampleWindow.cs +45 -0
- package/Samples~/UI Toolkit - MultiFile Selector (Editor)/Scripts/Editor/MultiFileSelectorSampleWindow.cs.meta +12 -0
- package/Samples~/UI Toolkit - MultiFile Selector (Editor)/Scripts/Editor/Samples.UnityHelpers.UIToolkit.Editor.asmdef +19 -0
- package/Samples~/UI Toolkit - MultiFile Selector (Editor)/Scripts/Editor/Samples.UnityHelpers.UIToolkit.Editor.asmdef.meta +8 -0
- package/Samples~/UI Toolkit - MultiFile Selector (Editor)/Scripts/Editor.meta +9 -0
- package/Samples~/UI Toolkit - MultiFile Selector (Editor)/Scripts.meta +9 -0
- package/Samples~/UI Toolkit - MultiFile Selector (Editor).meta +9 -0
- package/Shaders/Materials/BackgroundMask-Material.mat +59 -59
- package/Shaders/Materials/BackgroundMask-Material.mat.meta +8 -8
- package/Shaders/Materials.meta +8 -8
- package/Shaders/ShaderGraph/BackgroundMask.shadergraph +1653 -1653
- package/Shaders/ShaderGraph/BackgroundMask.shadergraph.meta +10 -10
- package/Shaders/ShaderGraph/DebugDisplayValue.shadersubgraph +835 -835
- package/Shaders/ShaderGraph/DebugDisplayValue.shadersubgraph.meta +10 -10
- package/Shaders/ShaderGraph.meta +8 -8
- package/Shaders/Support/EnhancedImageSupport.shader +64 -0
- package/Shaders/Support/EnhancedImageSupport.shader.meta +9 -0
- package/Shaders/Support.meta +8 -0
- package/Shaders.meta +8 -8
- package/Styles/Elements/Progress/ArcedProgressBar.cs +345 -345
- package/Styles/Elements/Progress/ArcedProgressBar.cs.meta +2 -2
- package/Styles/Elements/Progress/CircularProgressBar.cs +307 -307
- package/Styles/Elements/Progress/CircularProgressBar.cs.meta +2 -2
- package/Styles/Elements/Progress/GlitchProgressBar.cs +416 -416
- package/Styles/Elements/Progress/GlitchProgressBar.cs.meta +2 -2
- package/Styles/Elements/Progress/LiquidProgressBar.cs +632 -632
- package/Styles/Elements/Progress/LiquidProgressBar.cs.meta +2 -2
- package/Styles/Elements/Progress/MarchingAntsProgressBar.cs +722 -722
- package/Styles/Elements/Progress/MarchingAntsProgressBar.cs.meta +2 -2
- package/Styles/Elements/Progress/RegularProgressBar.cs +405 -405
- package/Styles/Elements/Progress/RegularProgressBar.cs.meta +2 -2
- package/Styles/Elements/Progress/WigglyProgressBar.cs +837 -837
- package/Styles/Elements/Progress/WigglyProgressBar.cs.meta +2 -2
- package/Styles/Elements/Progress.meta +2 -2
- package/Styles/Elements.meta +2 -2
- package/Styles/USS/ArcedProgressBar.uss +18 -18
- package/Styles/USS/ArcedProgressBar.uss.meta +2 -2
- package/Styles/USS/CirclularProgressBar.uss +17 -17
- package/Styles/USS/CirclularProgressBar.uss.meta +2 -2
- package/Styles/USS/RegularProgressBar.uss +32 -32
- package/Styles/USS/RegularProgressBar.uss.meta +2 -2
- package/Styles/USS/WigglyProgressBar.uss +16 -16
- package/Styles/USS/WigglyProgressBar.uss.meta +2 -2
- package/Styles/USS.meta +2 -2
- package/Styles/WallstopStudios.UnityHelpers.Styles.asmdef +14 -17
- package/Styles/WallstopStudios.UnityHelpers.Styles.asmdef.meta +7 -7
- package/Styles.meta +2 -2
- package/THIRD_PARTY_NOTICES.md +74 -0
- package/THIRD_PARTY_NOTICES.md.meta +7 -0
- package/Tests/Editor/Attributes/AnimationEventHelpersTests.cs +155 -0
- package/Tests/Editor/Attributes/AnimationEventHelpersTests.cs.meta +11 -0
- package/Tests/Editor/Attributes.meta +8 -0
- package/Tests/Editor/Core/Attributes/RelationalComponentAssignerTests.cs +118 -0
- package/Tests/Editor/Core/Attributes/RelationalComponentAssignerTests.cs.meta +11 -0
- package/Tests/Editor/Core/Attributes.meta +8 -0
- package/Tests/Editor/Core.meta +8 -0
- package/Tests/Editor/Extensions/SerializedPropertyExtensionsTests.cs +194 -0
- package/Tests/Editor/Extensions/SerializedPropertyExtensionsTests.cs.meta +3 -0
- package/Tests/Editor/Extensions.meta +3 -0
- package/Tests/Editor/Helper/DummyScriptableObject.cs +6 -0
- package/Tests/Editor/Helper/DummyScriptableObject.cs.meta +3 -0
- package/Tests/Editor/Helper/HelpersTests.cs +101 -0
- package/Tests/Editor/Helper/HelpersTests.cs.meta +3 -0
- package/Tests/Editor/Helper/ObjectHelpersEditorTests.cs +63 -0
- package/Tests/Editor/Helper/ObjectHelpersEditorTests.cs.meta +11 -0
- package/Tests/Editor/Helper/PromptScope.cs +28 -0
- package/Tests/Editor/Helper/PromptScope.cs.meta +11 -0
- package/Tests/Editor/Helper/ReflectionHelpersEditorTests.cs +105 -0
- package/Tests/Editor/Helper/ReflectionHelpersEditorTests.cs.meta +11 -0
- package/Tests/Editor/Helper/SpriteHelpersTests.cs +334 -0
- package/Tests/Editor/Helper/SpriteHelpersTests.cs.meta +3 -0
- package/Tests/Editor/Helper/SpriteSettingsApplierAdditionalTests.cs +183 -0
- package/Tests/Editor/Helper/SpriteSettingsApplierAdditionalTests.cs.meta +11 -0
- package/Tests/Editor/Helper/SpriteSettingsApplierTests.cs +161 -0
- package/Tests/Editor/Helper/SpriteSettingsApplierTests.cs.meta +11 -0
- package/Tests/Editor/Helper.meta +3 -0
- package/Tests/Editor/Integrations/VContainer/VContainerIntegrationCompilationTests.cs +40 -0
- package/Tests/Editor/Integrations/VContainer/VContainerIntegrationCompilationTests.cs.meta +11 -0
- package/Tests/Editor/Integrations/VContainer/VContainerRelationalEntryPointTests.cs +77 -0
- package/Tests/Editor/Integrations/VContainer/VContainerRelationalEntryPointTests.cs.meta +11 -0
- package/Tests/Editor/Integrations/VContainer/WallstopStudios.UnityHelpers.Tests.Editor.VContainer.asmdef +36 -0
- package/Tests/Editor/Integrations/VContainer/WallstopStudios.UnityHelpers.Tests.Editor.VContainer.asmdef.meta +7 -0
- package/Tests/Editor/Integrations/VContainer.meta +8 -0
- package/Tests/Editor/Integrations/Zenject/WallstopStudios.UnityHelpers.Tests.Editor.Zenject.asmdef +36 -0
- package/Tests/Editor/Integrations/Zenject/WallstopStudios.UnityHelpers.Tests.Editor.Zenject.asmdef.meta +7 -0
- package/Tests/Editor/Integrations/Zenject/ZenjectIntegrationCompilationTests.cs +40 -0
- package/Tests/Editor/Integrations/Zenject/ZenjectIntegrationCompilationTests.cs.meta +11 -0
- package/Tests/Editor/Integrations/Zenject/ZenjectRelationalInitializerTests.cs +76 -0
- package/Tests/Editor/Integrations/Zenject/ZenjectRelationalInitializerTests.cs.meta +11 -0
- package/Tests/Editor/Integrations/Zenject.meta +8 -0
- package/Tests/Editor/Integrations.meta +8 -0
- package/Tests/Editor/MultiFileSelectorElementTests.cs +265 -0
- package/Tests/Editor/MultiFileSelectorElementTests.cs.meta +11 -0
- package/Tests/Editor/MultiFileSelectorPersistenceManagerTests.cs +100 -0
- package/Tests/Editor/MultiFileSelectorPersistenceManagerTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/AnimationCopierWindowTests.cs +199 -0
- package/Tests/Editor/Sprites/AnimationCopierWindowTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/ScriptableSpriteAtlasEditorTests.cs +108 -0
- package/Tests/Editor/Sprites/ScriptableSpriteAtlasEditorTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/SpriteCropperAdditionalTests.cs +323 -0
- package/Tests/Editor/Sprites/SpriteCropperAdditionalTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/SpriteCropperTests.cs +162 -0
- package/Tests/Editor/Sprites/SpriteCropperTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/SpritePivotAdjusterAdditionalTests.cs +227 -0
- package/Tests/Editor/Sprites/SpritePivotAdjusterAdditionalTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/SpritePivotAdjusterTests.cs +113 -0
- package/Tests/Editor/Sprites/SpritePivotAdjusterTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/TexturePlatformNameHelperTests.cs +28 -0
- package/Tests/Editor/Sprites/TexturePlatformNameHelperTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/TextureResizerWizardTests.cs +248 -0
- package/Tests/Editor/Sprites/TextureResizerWizardTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/TextureSettingsApplierAPITests.cs +180 -0
- package/Tests/Editor/Sprites/TextureSettingsApplierAPITests.cs.meta +11 -0
- package/Tests/Editor/Sprites/TextureSettingsApplierWizardAdditionalTests.cs +295 -0
- package/Tests/Editor/Sprites/TextureSettingsApplierWizardAdditionalTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/TextureSettingsApplierWizardTests.cs +134 -0
- package/Tests/Editor/Sprites/TextureSettingsApplierWizardTests.cs.meta +11 -0
- package/Tests/Editor/Sprites.meta +8 -0
- package/Tests/Editor/TestComponents/PrewarmTesterComponent.cs +10 -0
- package/Tests/Editor/TestComponents/PrewarmTesterComponent.cs.meta +11 -0
- package/Tests/Editor/TestComponents.meta +8 -0
- package/Tests/Editor/Tools/ImageBlurToolTests.cs +135 -0
- package/Tests/Editor/Tools/ImageBlurToolTests.cs.meta +11 -0
- package/Tests/Editor/Tools.meta +8 -0
- package/Tests/Editor/Utils/CommonTestBase.cs +208 -0
- package/Tests/Editor/Utils/CommonTestBase.cs.meta +11 -0
- package/Tests/Editor/Utils/ScriptableObjectSingletonCreatorEditorTests.cs +306 -0
- package/Tests/Editor/Utils/ScriptableObjectSingletonCreatorEditorTests.cs.meta +9 -0
- package/Tests/Editor/Utils/ScriptableObjectSingletonCreatorTests.cs +183 -0
- package/Tests/Editor/Utils/ScriptableObjectSingletonCreatorTests.cs.meta +11 -0
- package/Tests/Editor/Utils/ScriptableObjectSingletonTests.cs +466 -0
- package/Tests/Editor/Utils/ScriptableObjectSingletonTests.cs.meta +11 -0
- package/Tests/Editor/Utils.meta +3 -0
- package/Tests/Editor/WallstopStudios.UnityHelpers.Tests.Editor.asmdef +19 -0
- package/Tests/Editor/WallstopStudios.UnityHelpers.Tests.Editor.asmdef.meta +7 -0
- package/Tests/Editor/Windows/FitTextureSizeWindowTests.cs +781 -0
- package/Tests/Editor/Windows/FitTextureSizeWindowTests.cs.meta +11 -0
- package/Tests/Editor/Windows/PrefabCheckerFolderAdditionTests.cs +96 -0
- package/Tests/Editor/Windows/PrefabCheckerFolderAdditionTests.cs.meta +11 -0
- package/Tests/Editor/Windows/PrefabCheckerTests.cs +81 -0
- package/Tests/Editor/Windows/PrefabCheckerTests.cs.meta +11 -0
- package/Tests/Editor/Windows.meta +8 -0
- package/Tests/Editor.meta +8 -0
- package/Tests/Runtime/AssemblyInfo.cs +4 -0
- package/Tests/Runtime/AssemblyInfo.cs.meta +3 -0
- package/Tests/Runtime/Attributes/ChildComponentTests.cs +766 -81
- package/Tests/Runtime/Attributes/ChildComponentTests.cs.meta +2 -2
- package/Tests/Runtime/Attributes/Components/ExpectChildSpriteRenderers.cs +28 -28
- package/Tests/Runtime/Attributes/Components/ExpectChildSpriteRenderers.cs.meta +2 -2
- package/Tests/Runtime/Attributes/Components/ExpectParentSpriteRenderers.cs +28 -28
- package/Tests/Runtime/Attributes/Components/ExpectParentSpriteRenderers.cs.meta +2 -2
- package/Tests/Runtime/{Components → Attributes/Components}/RelationalComponentTesterComplex.cs +34 -34
- package/Tests/Runtime/{Components → Attributes/Components}/RelationalComponentTesterComplex.cs.meta +2 -2
- package/Tests/Runtime/Attributes/Components/RelationalComponentsTesterSimple.cs +37 -0
- package/Tests/Runtime/{Components → Attributes/Components}/RelationalComponentsTesterSimple.cs.meta +2 -2
- package/Tests/Runtime/Attributes/Components.meta +2 -2
- package/Tests/Runtime/Attributes/MiscRuntimeAttributeTests.cs +75 -0
- package/Tests/Runtime/Attributes/MiscRuntimeAttributeTests.cs.meta +11 -0
- package/Tests/Runtime/Attributes/NotNullAttributeTests.cs +26 -0
- package/Tests/Runtime/Attributes/NotNullAttributeTests.cs.meta +3 -0
- package/Tests/Runtime/Attributes/ParentComponentTests.cs +565 -68
- package/Tests/Runtime/Attributes/ParentComponentTests.cs.meta +2 -2
- package/Tests/Runtime/Attributes/RelationalComponentAdvancedTests.cs +614 -0
- package/Tests/Runtime/Attributes/RelationalComponentAdvancedTests.cs.meta +11 -0
- package/Tests/Runtime/Attributes/RelationalComponentBackwardCompatibilityTests.cs +478 -0
- package/Tests/Runtime/Attributes/RelationalComponentBackwardCompatibilityTests.cs.meta +11 -0
- package/Tests/Runtime/Attributes/RelationalComponentExtensionsTests.cs +56 -0
- package/Tests/Runtime/Attributes/RelationalComponentExtensionsTests.cs.meta +11 -0
- package/Tests/Runtime/Attributes/RelationalComponentHashSetTests.cs +226 -0
- package/Tests/Runtime/Attributes/RelationalComponentHashSetTests.cs.meta +11 -0
- package/Tests/Runtime/Attributes/RelationalComponentInitializerTests.cs +109 -0
- package/Tests/Runtime/Attributes/RelationalComponentInitializerTests.cs.meta +11 -0
- package/Tests/Runtime/Attributes/RelationalComponentTagAndNameFilterEdgeTests.cs +234 -0
- package/Tests/Runtime/Attributes/RelationalComponentTagAndNameFilterEdgeTests.cs.meta +11 -0
- package/Tests/Runtime/Attributes/SiblingComponentTests.cs +721 -0
- package/Tests/Runtime/Attributes/SiblingComponentTests.cs.meta +11 -0
- package/Tests/Runtime/Attributes/ValidateAssignmentAttributeTests.cs +96 -0
- package/Tests/Runtime/Attributes/ValidateAssignmentAttributeTests.cs.meta +11 -0
- package/Tests/Runtime/Attributes.meta +2 -2
- package/Tests/Runtime/Core/Random/RandomComparerTests.cs +166 -0
- package/Tests/Runtime/Core/Random/RandomComparerTests.cs.meta +11 -0
- package/Tests/Runtime/Core/Random.meta +8 -0
- package/Tests/Runtime/Core/Threading/SingleThreadedThreadPoolTests.cs +56 -56
- package/Tests/Runtime/Core/Threading/SingleThreadedThreadPoolTests.cs.meta +2 -2
- package/Tests/Runtime/Core/Threading.meta +2 -2
- package/Tests/Runtime/Core.meta +2 -2
- package/Tests/Runtime/DataStructures/BalancedKDTree2DTests.cs +562 -0
- package/Tests/Runtime/DataStructures/{BalancedKDTreeTests.cs.meta → BalancedKDTree2DTests.cs.meta} +11 -11
- package/Tests/Runtime/DataStructures/BalancedKDTree3DTests.cs +10 -0
- package/Tests/Runtime/DataStructures/BalancedKDTree3DTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/BitSetTests.cs +1400 -0
- package/Tests/Runtime/DataStructures/BitSetTests.cs.meta +3 -0
- package/Tests/Runtime/DataStructures/BoundingBox3DTests.cs +1215 -0
- package/Tests/Runtime/DataStructures/BoundingBox3DTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/CircleTests.cs +965 -0
- package/Tests/Runtime/DataStructures/CircleTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/CyclicBufferTests.cs +2083 -324
- package/Tests/Runtime/DataStructures/CyclicBufferTests.cs.meta +2 -2
- package/Tests/Runtime/DataStructures/DequeTests.cs +790 -0
- package/Tests/Runtime/DataStructures/DequeTests.cs.meta +3 -0
- package/Tests/Runtime/DataStructures/DisjointSetTests.cs +1114 -0
- package/Tests/Runtime/DataStructures/DisjointSetTests.cs.meta +3 -0
- package/Tests/Runtime/DataStructures/FastOneOfTests.cs +966 -0
- package/Tests/Runtime/DataStructures/FastOneOfTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/FastVector2IntTests.cs +286 -0
- package/Tests/Runtime/DataStructures/FastVector2IntTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/FastVector3IntTests.cs +414 -0
- package/Tests/Runtime/DataStructures/FastVector3IntTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/HeapTests.cs +1953 -0
- package/Tests/Runtime/DataStructures/HeapTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/ImmutableBitSetTests.cs +833 -0
- package/Tests/Runtime/DataStructures/ImmutableBitSetTests.cs.meta +3 -0
- package/Tests/Runtime/DataStructures/KDTree3DTestsBase.cs +297 -0
- package/Tests/Runtime/DataStructures/KDTree3DTestsBase.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/OctTree3DTests.cs +351 -0
- package/Tests/Runtime/DataStructures/OctTree3DTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/PriorityQueueTests.cs +71 -0
- package/Tests/Runtime/DataStructures/PriorityQueueTests.cs.meta +3 -0
- package/Tests/Runtime/DataStructures/ProtobufSerializationTests.cs +475 -0
- package/Tests/Runtime/DataStructures/ProtobufSerializationTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/QuadTree2DTests.cs +660 -0
- package/Tests/Runtime/DataStructures/QuadTree2DTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/RTree2DTests.cs +823 -0
- package/Tests/Runtime/DataStructures/RTree2DTests.cs.meta +3 -0
- package/Tests/Runtime/DataStructures/RTree3DTests.cs +270 -0
- package/Tests/Runtime/DataStructures/RTree3DTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/SparseSetTests.cs +1146 -0
- package/Tests/Runtime/DataStructures/SparseSetTests.cs.meta +3 -0
- package/Tests/Runtime/DataStructures/SpatialHashTests.cs +992 -0
- package/Tests/Runtime/DataStructures/SpatialHashTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/SpatialTree2DBoundsConsistencyTests.cs +351 -0
- package/Tests/Runtime/DataStructures/SpatialTree2DBoundsConsistencyTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/SpatialTree2DBoundsEdgeTests.cs +127 -0
- package/Tests/Runtime/DataStructures/SpatialTree2DBoundsEdgeTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/SpatialTree2DBoundsFuzzTests.cs +218 -0
- package/Tests/Runtime/DataStructures/SpatialTree2DBoundsFuzzTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/SpatialTree2DTests.cs +396 -0
- package/Tests/Runtime/DataStructures/SpatialTree2DTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/SpatialTree3DBoundsConsistencyTests.cs +281 -0
- package/Tests/Runtime/DataStructures/SpatialTree3DBoundsConsistencyTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/SpatialTree3DBoundsEdgeTests.cs +127 -0
- package/Tests/Runtime/DataStructures/SpatialTree3DBoundsEdgeTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/SpatialTree3DBoundsFuzzTests.cs +170 -0
- package/Tests/Runtime/DataStructures/SpatialTree3DBoundsFuzzTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/SpatialTree3DTests.cs +474 -0
- package/Tests/Runtime/DataStructures/SpatialTree3DTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/SphereTests.cs +806 -0
- package/Tests/Runtime/DataStructures/SphereTests.cs.meta +3 -0
- package/Tests/Runtime/DataStructures/StringWrapperTests.cs +333 -0
- package/Tests/Runtime/DataStructures/StringWrapperTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/TimedCacheTests.cs +669 -0
- package/Tests/Runtime/DataStructures/TimedCacheTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/TrieTests.cs +3385 -0
- package/Tests/Runtime/DataStructures/TrieTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures/UnbalancedKDTree2DTests.cs +565 -0
- package/Tests/Runtime/DataStructures/{UnbalancedKDTreeTests.cs.meta → UnbalancedKDTree2DTests.cs.meta} +11 -11
- package/Tests/Runtime/DataStructures/UnbalancedKDTree3DTests.cs +10 -0
- package/Tests/Runtime/DataStructures/UnbalancedKDTree3DTests.cs.meta +11 -0
- package/Tests/Runtime/DataStructures.meta +8 -8
- package/Tests/Runtime/Extensions/AnimatorExtensionsTests.cs +28 -0
- package/Tests/Runtime/Extensions/AnimatorExtensionsTests.cs.meta +11 -0
- package/Tests/Runtime/Extensions/AsyncOperationExtensionsTests.cs +667 -0
- package/Tests/Runtime/Extensions/AsyncOperationExtensionsTests.cs.meta +11 -0
- package/Tests/Runtime/Extensions/CircleExtensionsTests.cs +230 -0
- package/Tests/Runtime/Extensions/CircleExtensionsTests.cs.meta +11 -0
- package/Tests/Runtime/Extensions/ColorExtensionsTests.cs +55 -0
- package/Tests/Runtime/Extensions/ColorExtensionsTests.cs.meta +11 -0
- package/Tests/Runtime/Extensions/DictionaryExtensionTests.cs +724 -438
- package/Tests/Runtime/Extensions/DictionaryExtensionTests.cs.meta +2 -2
- package/Tests/Runtime/Extensions/DirectionExtensionsComprehensiveTests.cs +403 -0
- package/Tests/Runtime/Extensions/DirectionExtensionsComprehensiveTests.cs.meta +11 -0
- package/Tests/Runtime/Extensions/DirectionExtensionsTests.cs +69 -0
- package/Tests/Runtime/Extensions/DirectionExtensionsTests.cs.meta +11 -0
- package/Tests/Runtime/Extensions/EnumExtensionTests.cs +809 -153
- package/Tests/Runtime/Extensions/EnumExtensionTests.cs.meta +2 -2
- package/Tests/Runtime/Extensions/IEnumerableExtensionsTests.cs +191 -0
- package/Tests/Runtime/Extensions/IEnumerableExtensionsTests.cs.meta +11 -0
- package/Tests/Runtime/Extensions/IListExtensionTests.cs +955 -169
- package/Tests/Runtime/Extensions/IListExtensionTests.cs.meta +2 -2
- package/Tests/Runtime/Extensions/IReadonlyListExtensionTests.cs +266 -58
- package/Tests/Runtime/Extensions/IReadonlyListExtensionTests.cs.meta +2 -2
- package/Tests/Runtime/Extensions/LoggingExtensionTests.cs +721 -718
- package/Tests/Runtime/Extensions/LoggingExtensionTests.cs.meta +2 -2
- package/Tests/Runtime/Extensions/ProtoEqualityExtensionsTests.cs +565 -0
- package/Tests/Runtime/Extensions/ProtoEqualityExtensionsTests.cs.meta +3 -0
- package/Tests/Runtime/Extensions/ProtoEqualityPolymorphismTests.cs +100 -0
- package/Tests/Runtime/Extensions/ProtoEqualityPolymorphismTests.cs.meta +11 -0
- package/Tests/Runtime/Extensions/RandomExtensionTests.cs +719 -27
- package/Tests/Runtime/Extensions/RandomExtensionTests.cs.meta +2 -2
- package/Tests/Runtime/Extensions/StringExtensionTests.cs +2592 -31
- package/Tests/Runtime/Extensions/StringExtensionTests.cs.meta +2 -2
- package/Tests/Runtime/Extensions/UnityExtensionsBasicTests.cs +166 -0
- package/Tests/Runtime/Extensions/UnityExtensionsBasicTests.cs.meta +11 -0
- package/Tests/Runtime/Extensions/UnityExtensionsComprehensiveTests.cs +1446 -0
- package/Tests/Runtime/Extensions/UnityExtensionsComprehensiveTests.cs.meta +11 -0
- package/Tests/Runtime/Extensions/UnityExtensionsMathTests.cs +1779 -0
- package/Tests/Runtime/Extensions/UnityExtensionsMathTests.cs.meta +11 -0
- package/Tests/Runtime/Extensions/UnityExtensionsVector2HullTests.cs +292 -0
- package/Tests/Runtime/Extensions/UnityExtensionsVector2HullTests.cs.meta +11 -0
- package/Tests/Runtime/Extensions/UnityLogTagFormatterEdgeTests.cs +260 -0
- package/Tests/Runtime/Extensions/UnityLogTagFormatterEdgeTests.cs.meta +11 -0
- package/Tests/Runtime/Extensions.meta +2 -2
- package/Tests/Runtime/Helper/ArrayConverterTests.cs +19 -19
- package/Tests/Runtime/Helper/ArrayConverterTests.cs.meta +2 -2
- package/Tests/Runtime/Helper/AssignUtilitiesTests.cs +38 -0
- package/Tests/Runtime/Helper/AssignUtilitiesTests.cs.meta +11 -0
- package/Tests/Runtime/Helper/DirectoryHelperTests.cs +347 -0
- package/Tests/Runtime/Helper/DirectoryHelperTests.cs.meta +11 -0
- package/Tests/Runtime/Helper/EnumerablesTests.cs +45 -0
- package/Tests/Runtime/Helper/EnumerablesTests.cs.meta +11 -0
- package/Tests/Runtime/Helper/FileHelperTests.cs +481 -0
- package/Tests/Runtime/Helper/FileHelperTests.cs.meta +11 -0
- package/Tests/Runtime/Helper/FormattingHelpersTests.cs +353 -0
- package/Tests/Runtime/Helper/FormattingHelpersTests.cs.meta +11 -0
- package/Tests/Runtime/Helper/FuncBasedComparerTests.cs +27 -0
- package/Tests/Runtime/Helper/FuncBasedComparerTests.cs.meta +11 -0
- package/Tests/Runtime/Helper/GeometryTests.cs +517 -0
- package/Tests/Runtime/Helper/GeometryTests.cs.meta +3 -0
- package/Tests/Runtime/Helper/HelpersTests.cs +749 -0
- package/Tests/Runtime/Helper/HelpersTests.cs.meta +11 -0
- package/Tests/Runtime/Helper/IterationHelpersTests.cs +173 -0
- package/Tests/Runtime/Helper/IterationHelpersTests.cs.meta +11 -0
- package/Tests/Runtime/Helper/LineHelperTests.cs +662 -0
- package/Tests/Runtime/Helper/LineHelperTests.cs.meta +11 -0
- package/Tests/Runtime/Helper/ObjectHelperTests.cs +444 -432
- package/Tests/Runtime/Helper/ObjectHelperTests.cs.meta +2 -2
- package/Tests/Runtime/Helper/ObjectsTests.cs +363 -0
- package/Tests/Runtime/Helper/ObjectsTests.cs.meta +3 -0
- package/Tests/Runtime/Helper/PathHelperTests.cs +183 -0
- package/Tests/Runtime/Helper/PathHelperTests.cs.meta +11 -0
- package/Tests/Runtime/Helper/ReflectionHelperTests.cs +2199 -1493
- package/Tests/Runtime/Helper/ReflectionHelperTests.cs.meta +2 -2
- package/Tests/Runtime/Helper/ReflectionHelpersMemberLookupTests.cs +192 -0
- package/Tests/Runtime/Helper/ReflectionHelpersMemberLookupTests.cs.meta +11 -0
- package/Tests/Runtime/Helper/ReflectionHelpersTypeScanningTests.cs +58 -0
- package/Tests/Runtime/Helper/ReflectionHelpersTypeScanningTests.cs.meta +11 -0
- package/Tests/Runtime/Helper/SceneHelperTests.cs +77 -94
- package/Tests/Runtime/Helper/SceneHelperTests.cs.meta +2 -2
- package/Tests/Runtime/Helper/UnityMainThreadDispatcherTests.cs +45 -0
- package/Tests/Runtime/Helper/UnityMainThreadDispatcherTests.cs.meta +11 -0
- package/Tests/Runtime/Helper/WallMathTests.cs +1884 -233
- package/Tests/Runtime/Helper/WallMathTests.cs.meta +2 -2
- package/Tests/Runtime/Helper.meta +2 -2
- package/Tests/Runtime/Integrations/VContainer/RelationalComponentsVContainerTests.cs +560 -0
- package/Tests/Runtime/Integrations/VContainer/RelationalComponentsVContainerTests.cs.meta +11 -0
- package/Tests/Runtime/Integrations/VContainer/WallstopStudios.UnityHelpers.Tests.Runtime.VContainer.asmdef +38 -0
- package/Tests/Runtime/Integrations/VContainer/WallstopStudios.UnityHelpers.Tests.Runtime.VContainer.asmdef.meta +7 -0
- package/Tests/Runtime/Integrations/VContainer.meta +8 -0
- package/Tests/Runtime/Integrations/Zenject/RelationalComponentsZenjectTests.cs +591 -0
- package/Tests/Runtime/Integrations/Zenject/RelationalComponentsZenjectTests.cs.meta +11 -0
- package/Tests/Runtime/Integrations/Zenject/WallstopStudios.UnityHelpers.Tests.Runtime.Zenject.asmdef +38 -0
- package/Tests/Runtime/Integrations/Zenject/WallstopStudios.UnityHelpers.Tests.Runtime.Zenject.asmdef.meta +7 -0
- package/Tests/Runtime/Integrations/Zenject.meta +8 -0
- package/Tests/Runtime/Integrations.meta +8 -0
- package/Tests/Runtime/Math/Line2DTests.cs +594 -0
- package/Tests/Runtime/Math/Line2DTests.cs.meta +11 -0
- package/Tests/Runtime/Math/Line3DTests.cs +655 -0
- package/Tests/Runtime/Math/Line3DTests.cs.meta +11 -0
- package/Tests/Runtime/Math/LineTests.cs +480 -0
- package/Tests/Runtime/Math/LineTests.cs.meta +11 -0
- package/Tests/Runtime/Math/ParabolaTests.cs +477 -0
- package/Tests/Runtime/Math/ParabolaTests.cs.meta +11 -0
- package/Tests/Runtime/Math/PointPolygonCheckTests.cs +939 -0
- package/Tests/Runtime/Math/PointPolygonCheckTests.cs.meta +11 -0
- package/Tests/Runtime/Math/RangeTests.cs +197 -0
- package/Tests/Runtime/Math/RangeTests.cs.meta +11 -0
- package/Tests/Runtime/Math.meta +8 -0
- package/Tests/Runtime/Performance/BenchmarkReadmeUpdater.cs +81 -0
- package/Tests/Runtime/Performance/BenchmarkReadmeUpdater.cs.meta +11 -0
- package/Tests/Runtime/Performance/JsonSerializationPerformanceTests.cs +421 -0
- package/Tests/Runtime/Performance/JsonSerializationPerformanceTests.cs.meta +3 -0
- package/Tests/Runtime/Performance/ListExtensionPerformanceTests.cs +76 -76
- package/Tests/Runtime/Performance/ListExtensionPerformanceTests.cs.meta +2 -2
- package/Tests/Runtime/Performance/ProtoEqualsPerformanceTests.cs +161 -0
- package/Tests/Runtime/Performance/ProtoEqualsPerformanceTests.cs.meta +11 -0
- package/Tests/Runtime/Performance/ProtoSerializationPerformanceTests.cs +207 -0
- package/Tests/Runtime/Performance/ProtoSerializationPerformanceTests.cs.meta +3 -0
- package/Tests/Runtime/Performance/RandomPerformanceTests.cs +195 -181
- package/Tests/Runtime/Performance/RandomPerformanceTests.cs.meta +11 -11
- package/Tests/Runtime/Performance/RelationComponentPerformanceTests.cs +60 -61
- package/Tests/Runtime/Performance/RelationComponentPerformanceTests.cs.meta +2 -2
- package/Tests/Runtime/Performance/SpatialTree2DPerformanceTests.cs +692 -0
- package/Tests/Runtime/Performance/SpatialTree2DPerformanceTests.cs.meta +11 -0
- package/Tests/Runtime/Performance/SpatialTree3DPerformanceTests.cs +650 -0
- package/Tests/Runtime/Performance/SpatialTree3DPerformanceTests.cs.meta +11 -0
- package/Tests/Runtime/Performance.meta +8 -8
- package/Tests/Runtime/Random/DotNetRandomTests.cs +9 -9
- package/Tests/Runtime/Random/DotNetRandomTests.cs.meta +2 -2
- package/Tests/Runtime/Random/IllusionFlowTests.cs +12 -12
- package/Tests/Runtime/Random/IllusionFlowTests.cs.meta +2 -2
- package/Tests/Runtime/Random/LinearCongruentialGeneratorTests.cs +12 -12
- package/Tests/Runtime/Random/LinearCongruentialGeneratorTests.cs.meta +2 -2
- package/Tests/Runtime/Random/PcgRandomTests.cs +9 -9
- package/Tests/Runtime/Random/PcgRandomTests.cs.meta +11 -11
- package/Tests/Runtime/Random/RandomProtoSerializationTests.cs +494 -0
- package/Tests/Runtime/Random/RandomProtoSerializationTests.cs.meta +3 -0
- package/Tests/Runtime/Random/RandomStateSerializationTests.cs +304 -0
- package/Tests/Runtime/Random/RandomStateSerializationTests.cs.meta +4 -0
- package/Tests/Runtime/Random/RandomTestBase.cs +836 -787
- package/Tests/Runtime/Random/RandomTestBase.cs.meta +11 -11
- package/Tests/Runtime/Random/RomuDuoRandomTests.cs +9 -9
- package/Tests/Runtime/Random/RomuDuoRandomTests.cs.meta +2 -2
- package/Tests/Runtime/Random/SplitMix64RandomTests.cs +9 -9
- package/Tests/Runtime/Random/SplitMix64RandomTests.cs.meta +2 -2
- package/Tests/Runtime/Random/SquirrelRandomTests.cs +14 -14
- package/Tests/Runtime/Random/SquirrelRandomTests.cs.meta +11 -11
- package/Tests/Runtime/Random/SystemRandomTests.cs +10 -10
- package/Tests/Runtime/Random/SystemRandomTests.cs.meta +11 -11
- package/Tests/Runtime/Random/UnityRandomTests.cs +9 -9
- package/Tests/Runtime/Random/UnityRandomTests.cs.meta +11 -11
- package/Tests/Runtime/Random/WyRandomTests.cs +9 -9
- package/Tests/Runtime/Random/WyRandomTests.cs.meta +2 -2
- package/Tests/Runtime/Random/XorShiftRandomTests.cs +9 -9
- package/Tests/Runtime/Random/XorShiftRandomTests.cs.meta +11 -11
- package/Tests/Runtime/Random/XoroShiroRandomTests.cs +9 -9
- package/Tests/Runtime/Random/XoroShiroRandomTests.cs.meta +2 -2
- package/Tests/Runtime/Random.meta +8 -8
- package/Tests/Runtime/RuntimeTestTimeouts.cs +3 -0
- package/Tests/Runtime/RuntimeTestTimeouts.cs.meta +11 -0
- package/Tests/Runtime/Scenes/Test1.unity +723 -723
- package/Tests/Runtime/Scenes/Test1.unity.meta +7 -7
- package/Tests/Runtime/Scenes/Test2.unity +723 -723
- package/Tests/Runtime/Scenes/Test2.unity.meta +7 -7
- package/Tests/Runtime/Scenes.meta +2 -2
- package/Tests/Runtime/Serialization/AdaptersJsonTests.cs +67 -0
- package/Tests/Runtime/Serialization/AdaptersJsonTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/BitSetJsonTests.cs +50 -0
- package/Tests/Runtime/Serialization/BitSetJsonTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/CyclicBufferJsonTests.cs +67 -0
- package/Tests/Runtime/Serialization/CyclicBufferJsonTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/DequeJsonTests.cs +70 -0
- package/Tests/Runtime/Serialization/DequeJsonTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/ImmutableBitSetJsonTests.cs +25 -0
- package/Tests/Runtime/Serialization/ImmutableBitSetJsonTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/JsonConverterTests.cs +1157 -0
- package/Tests/Runtime/Serialization/JsonConverterTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/JsonRoundtripComprehensiveTests.cs +239 -0
- package/Tests/Runtime/Serialization/JsonRoundtripComprehensiveTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/JsonSerializationCorrectnessTests.cs +458 -0
- package/Tests/Runtime/Serialization/JsonSerializationCorrectnessTests.cs.meta +3 -0
- package/Tests/Runtime/Serialization/JsonSerializationTest.cs +156 -156
- package/Tests/Runtime/Serialization/JsonSerializationTest.cs.meta +2 -2
- package/Tests/Runtime/Serialization/MathJsonTests.cs +79 -0
- package/Tests/Runtime/Serialization/MathJsonTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/ProtoInterfaceResolutionEdgeTests.cs +76 -0
- package/Tests/Runtime/Serialization/ProtoInterfaceResolutionEdgeTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/ProtoRootRegistrationTests.cs +80 -0
- package/Tests/Runtime/Serialization/ProtoRootRegistrationTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/ProtoRoundtripComprehensiveTests.cs +257 -0
- package/Tests/Runtime/Serialization/ProtoRoundtripComprehensiveTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/ProtoSerializationCorrectnessTests.cs +471 -0
- package/Tests/Runtime/Serialization/ProtoSerializationCorrectnessTests.cs.meta +3 -0
- package/Tests/Runtime/Serialization/ProtoSerializationTests.cs +169 -0
- package/Tests/Runtime/Serialization/ProtoSerializationTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/ProtoSerializeBehaviorTests.cs +62 -0
- package/Tests/Runtime/Serialization/ProtoSerializeBehaviorTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/SerializerAdditionalTests.cs +895 -0
- package/Tests/Runtime/Serialization/SerializerAdditionalTests.cs.meta +3 -0
- package/Tests/Runtime/Serialization/TypeConverterTests.cs +34 -0
- package/Tests/Runtime/Serialization/TypeConverterTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization.meta +2 -2
- package/Tests/Runtime/Tags/AttributeComponentTests.cs +174 -0
- package/Tests/Runtime/Tags/AttributeComponentTests.cs.meta +3 -0
- package/Tests/Runtime/Tags/AttributeDataTests.cs +312 -0
- package/Tests/Runtime/Tags/AttributeDataTests.cs.meta +11 -0
- package/Tests/Runtime/Tags/AttributeUtilitiesTests.cs +405 -0
- package/Tests/Runtime/Tags/AttributeUtilitiesTests.cs.meta +3 -0
- package/Tests/Runtime/Tags/CosmeticAndCollisionTests.cs +147 -0
- package/Tests/Runtime/Tags/CosmeticAndCollisionTests.cs.meta +11 -0
- package/Tests/Runtime/Tags/CosmeticEffectDataTests.cs +60 -0
- package/Tests/Runtime/Tags/CosmeticEffectDataTests.cs.meta +3 -0
- package/Tests/Runtime/Tags/EffectHandleTests.cs +61 -0
- package/Tests/Runtime/Tags/EffectHandleTests.cs.meta +3 -0
- package/Tests/Runtime/Tags/EffectHandlerTests.cs +270 -0
- package/Tests/Runtime/Tags/EffectHandlerTests.cs.meta +3 -0
- package/Tests/Runtime/Tags/Helpers/RecordingCosmeticComponent.cs +39 -0
- package/Tests/Runtime/Tags/Helpers/RecordingCosmeticComponent.cs.meta +3 -0
- package/Tests/Runtime/Tags/Helpers/TagTestBase.cs +49 -0
- package/Tests/Runtime/Tags/Helpers/TagTestBase.cs.meta +3 -0
- package/Tests/Runtime/Tags/Helpers/TestAttributesComponent.cs +28 -0
- package/Tests/Runtime/Tags/Helpers/TestAttributesComponent.cs.meta +3 -0
- package/Tests/Runtime/Tags/Helpers.meta +3 -0
- package/Tests/Runtime/Tags/TagHandlerTests.cs +108 -0
- package/Tests/Runtime/Tags/TagHandlerTests.cs.meta +3 -0
- package/Tests/Runtime/Tags.meta +8 -0
- package/Tests/Runtime/TestUtils/CommonTestBase.cs +213 -0
- package/Tests/Runtime/TestUtils/CommonTestBase.cs.meta +11 -0
- package/Tests/Runtime/TestUtils/GCAssert.cs +55 -0
- package/Tests/Runtime/TestUtils/GCAssert.cs.meta +11 -0
- package/Tests/Runtime/TestUtils/SpatialAssert.cs +33 -0
- package/Tests/Runtime/TestUtils/SpatialAssert.cs.meta +11 -0
- package/Tests/Runtime/TestUtils/SpatialDiagnostics.cs +195 -0
- package/Tests/Runtime/TestUtils/SpatialDiagnostics.cs.meta +11 -0
- package/Tests/Runtime/TestUtils.meta +8 -0
- package/Tests/Runtime/Utils/AnimationEventEqualityComparerTests.cs +144 -0
- package/Tests/Runtime/Utils/AnimationEventEqualityComparerTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/Ascii85Tests.cs +56 -0
- package/Tests/Runtime/Utils/Ascii85Tests.cs.meta +11 -0
- package/Tests/Runtime/Utils/BuffersTests.cs +1148 -741
- package/Tests/Runtime/Utils/BuffersTests.cs.meta +2 -2
- package/Tests/Runtime/Utils/BuffersWaitInstructionTests.cs +31 -0
- package/Tests/Runtime/Utils/BuffersWaitInstructionTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/CenterPointOffsetTests.cs +67 -0
- package/Tests/Runtime/Utils/CenterPointOffsetTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/ChildSpawnerTests.cs +490 -0
- package/Tests/Runtime/Utils/ChildSpawnerTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/CircleLineRendererTests.cs +80 -0
- package/Tests/Runtime/Utils/CircleLineRendererTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/CollisionProxyTests.cs +442 -0
- package/Tests/Runtime/Utils/CollisionProxyTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/CoroutineHandlerTests.cs +353 -0
- package/Tests/Runtime/Utils/CoroutineHandlerTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/DeferredDisposalResultTests.cs +44 -0
- package/Tests/Runtime/Utils/DeferredDisposalResultTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/LZMAComprehensiveTests.cs +249 -0
- package/Tests/Runtime/Utils/LZMAComprehensiveTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/LZMATests.cs +31 -0
- package/Tests/Runtime/Utils/LZMATests.cs.meta +11 -0
- package/Tests/Runtime/Utils/MatchColliderToSpriteAdditionalTests.cs +86 -0
- package/Tests/Runtime/Utils/MatchColliderToSpriteAdditionalTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/MatchColliderToSpriteTests.cs +503 -0
- package/Tests/Runtime/Utils/MatchColliderToSpriteTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/MatchTransformEdgeTests.cs +34 -0
- package/Tests/Runtime/Utils/MatchTransformEdgeTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/MatchTransformTests.cs +495 -0
- package/Tests/Runtime/Utils/MatchTransformTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/OscillatorTests.cs +540 -0
- package/Tests/Runtime/Utils/OscillatorTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/PolygonCollider2DOptimizerTests.cs +52 -0
- package/Tests/Runtime/Utils/PolygonCollider2DOptimizerTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/RuntimeSingletonTests.cs +766 -0
- package/Tests/Runtime/Utils/RuntimeSingletonTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/SerializedStringComparerEdgeTests.cs +47 -0
- package/Tests/Runtime/Utils/SerializedStringComparerEdgeTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/SerializedStringComparerTests.cs +361 -0
- package/Tests/Runtime/Utils/SerializedStringComparerTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/SpriteRendererMetadataTests.cs +383 -398
- package/Tests/Runtime/Utils/SpriteRendererMetadataTests.cs.meta +2 -2
- package/Tests/Runtime/Utils/SpriteRendererSyncTests.cs +134 -0
- package/Tests/Runtime/Utils/SpriteRendererSyncTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/StartTrackerTests.cs +24 -0
- package/Tests/Runtime/Utils/StartTrackerTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/TextureScaleEdgeTests.cs +114 -0
- package/Tests/Runtime/Utils/TextureScaleEdgeTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/TextureScaleTests.cs +298 -0
- package/Tests/Runtime/Utils/TextureScaleTests.cs.meta +3 -0
- package/Tests/Runtime/Utils/TypeNameSorterAdditionalTests.cs +36 -0
- package/Tests/Runtime/Utils/TypeNameSorterAdditionalTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/TypeNameSorterTests.cs +34 -0
- package/Tests/Runtime/Utils/TypeNameSorterTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/UnityObjectNameComparerEdgeTests.cs +63 -0
- package/Tests/Runtime/Utils/UnityObjectNameComparerEdgeTests.cs.meta +11 -0
- package/Tests/Runtime/Utils/UnityObjectNameComparerTests.cs +59 -0
- package/Tests/Runtime/Utils/UnityObjectNameComparerTests.cs.meta +11 -0
- package/Tests/Runtime/Utils.meta +2 -2
- package/Tests/Runtime/Visuals/AnimatedSpriteLayerTests.cs +266 -0
- package/Tests/Runtime/Visuals/AnimatedSpriteLayerTests.cs.meta +11 -0
- package/Tests/Runtime/Visuals/EnhancedImageTests.cs +184 -0
- package/Tests/Runtime/Visuals/EnhancedImageTests.cs.meta +11 -0
- package/Tests/Runtime/Visuals/LayeredImageTests.cs +422 -0
- package/Tests/Runtime/Visuals/LayeredImageTests.cs.meta +11 -0
- package/Tests/Runtime/Visuals/VisualsTestHelpers.cs +132 -0
- package/Tests/Runtime/Visuals/VisualsTestHelpers.cs.meta +11 -0
- package/Tests/Runtime/Visuals.meta +3 -0
- package/Tests/Runtime/WallstopStudios.UnityHelpers.Tests.Runtime.asmdef +24 -23
- package/Tests/Runtime/WallstopStudios.UnityHelpers.Tests.Runtime.asmdef.meta +7 -7
- package/Tests/Runtime.meta +8 -8
- package/Tests.meta +8 -8
- package/URP/VolumeProfiles/Post Processing Bloom Profile(URP).asset +63 -63
- package/URP/VolumeProfiles/Post Processing Bloom Profile(URP).asset.meta +8 -8
- package/URP/VolumeProfiles.meta +8 -8
- package/URP.meta +8 -8
- package/node_modules.meta +8 -0
- package/package.json +95 -38
- package/package.json.meta +7 -7
- package/scripts/check-eol.ps1 +52 -0
- package/scripts/check-eol.ps1.meta +7 -0
- package/scripts/clean-nul.ps1 +29 -0
- package/scripts/clean-nul.ps1.meta +7 -0
- package/scripts/lint-doc-links.ps1 +80 -0
- package/scripts/lint-doc-links.ps1.meta +7 -0
- package/scripts/normalize-eol.ps1 +71 -0
- package/scripts/normalize-eol.ps1.meta +7 -0
- package/scripts.meta +8 -0
- package/Editor/Sprites/ProjectAnimationSettings.cs +0 -50
- package/Editor/Sprites/ProjectAnimationSettings.cs.meta +0 -3
- package/Editor/Sprites/TextureSettingsApplier.cs +0 -178
- package/Editor/Sprites/TextureSettingsApplier.cs.meta +0 -3
- package/Runtime/Core/Attributes/ParentComponent.cs +0 -189
- package/Runtime/Core/DataStructure/KDTree.cs +0 -434
- package/Runtime/Core/DataStructure/QuadTree.cs +0 -431
- package/Runtime/Core/DataStructure/RTree.cs +0 -356
- package/Runtime/Core/Extension/HashSetExtensions.cs +0 -12
- package/Runtime/Core/Extension/HashSetExtensions.cs.meta +0 -11
- package/Runtime/Core/Math/Line.cs +0 -55
- package/Runtime/Core/Math/Line.cs.meta +0 -11
- package/Runtime/Core/Math/XXHash.cs +0 -310
- package/Runtime/Core/Math/XXHash.cs.meta +0 -11
- package/Tests/Runtime/Components/RelationalComponentsTesterSimple.cs +0 -40
- package/Tests/Runtime/Components.meta +0 -3
- package/Tests/Runtime/DataStructures/BalancedKDTreeTests.cs +0 -14
- package/Tests/Runtime/DataStructures/QuadTreeTests.cs +0 -14
- package/Tests/Runtime/DataStructures/QuadTreeTests.cs.meta +0 -11
- package/Tests/Runtime/DataStructures/SpatialTreeTests.cs +0 -130
- package/Tests/Runtime/DataStructures/SpatialTreeTests.cs.meta +0 -11
- package/Tests/Runtime/DataStructures/UnbalancedKDTreeTests.cs +0 -14
- package/Tests/Runtime/Helper/FormattingHelperTests.cs +0 -129
- package/Tests/Runtime/Helper/FormattingHelperTests.cs.meta +0 -3
- package/Tests/Runtime/Performance/KDTreePerformanceTests.cs +0 -14
- package/Tests/Runtime/Performance/KDTreePerformanceTests.cs.meta +0 -11
- package/Tests/Runtime/Performance/QuadTreePerformanceTests.cs +0 -14
- package/Tests/Runtime/Performance/QuadTreePerformanceTests.cs.meta +0 -11
- package/Tests/Runtime/Performance/SpatialTreePerformanceTest.cs +0 -158
- package/Tests/Runtime/Performance/SpatialTreePerformanceTest.cs.meta +0 -11
- package/Tests/Runtime/Performance/UnbalancedKDTreeTests.cs +0 -14
- package/Tests/Runtime/Performance/UnbalancedKDTreeTests.cs.meta +0 -11
- package/Third Party Notices.md +0 -1
package/Runtime/Utils/Buffers.cs
CHANGED
|
@@ -1,550 +1,1151 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
using
|
|
8
|
-
|
|
9
|
-
using System.
|
|
10
|
-
using
|
|
11
|
-
#
|
|
12
|
-
using
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
private static readonly Dictionary<float,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
private static readonly ConcurrentDictionary<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
private static
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
1
|
+
namespace WallstopStudios.UnityHelpers.Utils
|
|
2
|
+
{
|
|
3
|
+
using System;
|
|
4
|
+
using System.Collections.Generic;
|
|
5
|
+
using System.Diagnostics;
|
|
6
|
+
using System.Text;
|
|
7
|
+
using UnityEngine;
|
|
8
|
+
#if !SINGLE_THREADED
|
|
9
|
+
using System.Threading;
|
|
10
|
+
using System.Collections.Concurrent;
|
|
11
|
+
#else
|
|
12
|
+
using WallstopStudios.UnityHelpers.Core.Extension;
|
|
13
|
+
#endif
|
|
14
|
+
/// <summary>
|
|
15
|
+
/// Provides thread-safe pooled access to commonly used Unity coroutine yield instructions and StringBuilder instances.
|
|
16
|
+
/// This class helps reduce allocations by reusing frequently created objects.
|
|
17
|
+
/// </summary>
|
|
18
|
+
public static class Buffers
|
|
19
|
+
{
|
|
20
|
+
#if SINGLE_THREADED
|
|
21
|
+
private static readonly Dictionary<float, WaitForSeconds> WaitForSeconds = new();
|
|
22
|
+
private static readonly Dictionary<float, WaitForSecondsRealtime> WaitForSecondsRealtime =
|
|
23
|
+
new();
|
|
24
|
+
#else
|
|
25
|
+
private static readonly ConcurrentDictionary<float, WaitForSeconds> WaitForSeconds = new();
|
|
26
|
+
private static readonly ConcurrentDictionary<
|
|
27
|
+
float,
|
|
28
|
+
WaitForSecondsRealtime
|
|
29
|
+
> WaitForSecondsRealtime = new();
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
/// <summary>
|
|
33
|
+
/// Reusable WaitForFixedUpdate instance to avoid repeated allocations in coroutines.
|
|
34
|
+
/// Use this when waiting for the next fixed update frame.
|
|
35
|
+
/// </summary>
|
|
36
|
+
public static readonly WaitForFixedUpdate WaitForFixedUpdate = new();
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
/// Reusable WaitForEndOfFrame instance to avoid repeated allocations in coroutines.
|
|
40
|
+
/// Use this when waiting for the end of the current frame.
|
|
41
|
+
/// </summary>
|
|
42
|
+
public static readonly WaitForEndOfFrame WaitForEndOfFrame = new();
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
/// Generic pool for StringBuilder instances. Automatically clears the StringBuilder when returned to the pool.
|
|
46
|
+
/// Use this to reduce allocations when building strings.
|
|
47
|
+
/// </summary>
|
|
48
|
+
public static readonly WallstopGenericPool<StringBuilder> StringBuilder = new(
|
|
49
|
+
() => new StringBuilder(),
|
|
50
|
+
onRelease: builder => builder.Clear()
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
/// <summary>
|
|
54
|
+
/// Gets a pooled StringBuilder with at least the requested capacity.
|
|
55
|
+
/// </summary>
|
|
56
|
+
public static PooledResource<StringBuilder> GetStringBuilder(
|
|
57
|
+
int capacity,
|
|
58
|
+
out StringBuilder builder
|
|
59
|
+
)
|
|
60
|
+
{
|
|
61
|
+
PooledResource<StringBuilder> pooled = StringBuilder.Get(out builder);
|
|
62
|
+
if (builder.Capacity < capacity)
|
|
63
|
+
{
|
|
64
|
+
builder.Capacity = capacity;
|
|
65
|
+
}
|
|
66
|
+
return pooled;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/// <summary>
|
|
70
|
+
/// Gets a cached WaitForSeconds instance for the specified duration.
|
|
71
|
+
/// This method caches instances to avoid repeated allocations in coroutines.
|
|
72
|
+
/// </summary>
|
|
73
|
+
/// <param name="seconds">The duration to wait in seconds.</param>
|
|
74
|
+
/// <returns>A WaitForSeconds instance that waits for the specified duration.</returns>
|
|
75
|
+
/// <remarks>
|
|
76
|
+
/// IMPORTANT: Only use with CONSTANT time values, otherwise this is a memory leak.
|
|
77
|
+
/// DO NOT USE with random or variable values as each unique value creates a cached entry that persists forever.
|
|
78
|
+
/// </remarks>
|
|
79
|
+
public static WaitForSeconds GetWaitForSeconds(float seconds)
|
|
80
|
+
{
|
|
81
|
+
return WaitForSeconds.GetOrAdd(seconds, value => new WaitForSeconds(value));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/// <summary>
|
|
85
|
+
/// Gets a cached WaitForSecondsRealtime instance for the specified duration.
|
|
86
|
+
/// This method caches instances to avoid repeated allocations in coroutines.
|
|
87
|
+
/// Unlike WaitForSeconds, this uses unscaled (real) time.
|
|
88
|
+
/// </summary>
|
|
89
|
+
/// <param name="seconds">The duration to wait in real seconds (unaffected by Time.timeScale).</param>
|
|
90
|
+
/// <returns>A WaitForSecondsRealtime instance that waits for the specified duration.</returns>
|
|
91
|
+
/// <remarks>
|
|
92
|
+
/// IMPORTANT: Only use with CONSTANT time values, otherwise this is a memory leak.
|
|
93
|
+
/// DO NOT USE with random or variable values as each unique value creates a cached entry that persists forever.
|
|
94
|
+
/// </remarks>
|
|
95
|
+
public static WaitForSecondsRealtime GetWaitForSecondsRealTime(float seconds)
|
|
96
|
+
{
|
|
97
|
+
return WaitForSecondsRealtime.GetOrAdd(
|
|
98
|
+
seconds,
|
|
99
|
+
value => new WaitForSecondsRealtime(value)
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/// <summary>
|
|
105
|
+
/// Provides thread-safe generic pools for commonly used collection types.
|
|
106
|
+
/// All collections are automatically cleared when returned to their respective pools.
|
|
107
|
+
/// </summary>
|
|
108
|
+
/// <typeparam name="T">The element type for the collections.</typeparam>
|
|
109
|
+
public static class Buffers<T>
|
|
110
|
+
{
|
|
111
|
+
/// <summary>
|
|
112
|
+
/// Generic pool for List<T> instances. Lists are automatically cleared when returned to the pool.
|
|
113
|
+
/// </summary>
|
|
114
|
+
public static readonly WallstopGenericPool<List<T>> List = new(
|
|
115
|
+
() => new List<T>(),
|
|
116
|
+
onRelease: list => list.Clear()
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
/// <summary>
|
|
120
|
+
/// Gets a pooled List with at least the requested capacity.
|
|
121
|
+
/// </summary>
|
|
122
|
+
public static PooledResource<List<T>> GetList(int capacity, out List<T> list)
|
|
123
|
+
{
|
|
124
|
+
PooledResource<List<T>> pooled = List.Get(out list);
|
|
125
|
+
if (list.Capacity < capacity)
|
|
126
|
+
{
|
|
127
|
+
list.Capacity = capacity;
|
|
128
|
+
}
|
|
129
|
+
return pooled;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/// <summary>
|
|
133
|
+
/// Generic pool for HashSet<T> instances. Sets are automatically cleared when returned to the pool.
|
|
134
|
+
/// </summary>
|
|
135
|
+
public static readonly WallstopGenericPool<HashSet<T>> HashSet = new(
|
|
136
|
+
() => new HashSet<T>(),
|
|
137
|
+
onRelease: set => set.Clear()
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
/// <summary>
|
|
141
|
+
/// Generic pool for Queue<T> instances. Queues are automatically cleared when returned to the pool.
|
|
142
|
+
/// </summary>
|
|
143
|
+
public static readonly WallstopGenericPool<Queue<T>> Queue = new(
|
|
144
|
+
() => new Queue<T>(),
|
|
145
|
+
onRelease: queue => queue.Clear()
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
/// <summary>
|
|
149
|
+
/// Generic pool for Stack<T> instances. Stacks are automatically cleared when returned to the pool.
|
|
150
|
+
/// </summary>
|
|
151
|
+
public static readonly WallstopGenericPool<Stack<T>> Stack = new(
|
|
152
|
+
() => new Stack<T>(),
|
|
153
|
+
onRelease: stack => stack.Clear()
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
public static class StopwatchBuffers
|
|
158
|
+
{
|
|
159
|
+
public static readonly WallstopGenericPool<Stopwatch> Stopwatch = new(
|
|
160
|
+
() => System.Diagnostics.Stopwatch.StartNew(),
|
|
161
|
+
onGet: stopwatch => stopwatch.Restart(),
|
|
162
|
+
onRelease: stopwatch => stopwatch.Stop()
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/// <summary>
|
|
167
|
+
/// Provides thread-safe generic pools for set collections with custom comparers.
|
|
168
|
+
/// Includes factory methods to create pools with custom equality and comparison logic.
|
|
169
|
+
/// </summary>
|
|
170
|
+
/// <typeparam name="T">The element type for the sets.</typeparam>
|
|
171
|
+
public static class SetBuffers<T>
|
|
172
|
+
{
|
|
173
|
+
/// <summary>
|
|
174
|
+
/// Generic pool for SortedSet<T> instances using the default comparer.
|
|
175
|
+
/// Sets are automatically cleared when returned to the pool.
|
|
176
|
+
/// </summary>
|
|
177
|
+
public static readonly WallstopGenericPool<SortedSet<T>> SortedSet = new(
|
|
178
|
+
() => new SortedSet<T>(),
|
|
179
|
+
onRelease: set => set.Clear()
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
#if SINGLE_THREADED
|
|
183
|
+
private static readonly Dictionary<
|
|
184
|
+
IComparer<T>,
|
|
185
|
+
WallstopGenericPool<SortedSet<T>>
|
|
186
|
+
> SortedSetCache = new();
|
|
187
|
+
private static readonly Dictionary<
|
|
188
|
+
IEqualityComparer<T>,
|
|
189
|
+
WallstopGenericPool<HashSet<T>>
|
|
190
|
+
> HashSetCache = new();
|
|
191
|
+
#else
|
|
192
|
+
private static readonly ConcurrentDictionary<
|
|
193
|
+
IComparer<T>,
|
|
194
|
+
WallstopGenericPool<SortedSet<T>>
|
|
195
|
+
> SortedSetCache = new();
|
|
196
|
+
private static readonly ConcurrentDictionary<
|
|
197
|
+
IEqualityComparer<T>,
|
|
198
|
+
WallstopGenericPool<HashSet<T>>
|
|
199
|
+
> HashSetCache = new();
|
|
200
|
+
#endif
|
|
201
|
+
|
|
202
|
+
/// <summary>
|
|
203
|
+
/// Gets or creates a pool for SortedSet<T> instances that use the specified comparer.
|
|
204
|
+
/// The pool is cached and reused for subsequent calls with the same comparer instance.
|
|
205
|
+
/// </summary>
|
|
206
|
+
/// <param name="comparer">The comparer to use for sorting elements in the set.</param>
|
|
207
|
+
/// <returns>A pool that creates SortedSet instances with the specified comparer.</returns>
|
|
208
|
+
/// <exception cref="ArgumentNullException">Thrown when comparer is null.</exception>
|
|
209
|
+
public static WallstopGenericPool<SortedSet<T>> GetSortedSetPool(IComparer<T> comparer)
|
|
210
|
+
{
|
|
211
|
+
return comparer == null
|
|
212
|
+
? throw new ArgumentNullException(nameof(comparer))
|
|
213
|
+
: SortedSetCache.GetOrAdd(
|
|
214
|
+
comparer,
|
|
215
|
+
inComparer => new WallstopGenericPool<SortedSet<T>>(
|
|
216
|
+
() => new SortedSet<T>(inComparer),
|
|
217
|
+
onRelease: set => set.Clear()
|
|
218
|
+
)
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/// <summary>
|
|
223
|
+
/// Gets or creates a pool for HashSet<T> instances that use the specified equality comparer.
|
|
224
|
+
/// The pool is cached and reused for subsequent calls with the same comparer instance.
|
|
225
|
+
/// </summary>
|
|
226
|
+
/// <param name="comparer">The equality comparer to use for determining element equality.</param>
|
|
227
|
+
/// <returns>A pool that creates HashSet instances with the specified equality comparer.</returns>
|
|
228
|
+
/// <exception cref="ArgumentNullException">Thrown when comparer is null.</exception>
|
|
229
|
+
public static WallstopGenericPool<HashSet<T>> GetHashSetPool(IEqualityComparer<T> comparer)
|
|
230
|
+
{
|
|
231
|
+
return comparer == null
|
|
232
|
+
? throw new ArgumentNullException(nameof(comparer))
|
|
233
|
+
: HashSetCache.GetOrAdd(
|
|
234
|
+
comparer,
|
|
235
|
+
inComparer => new WallstopGenericPool<HashSet<T>>(
|
|
236
|
+
() => new HashSet<T>(inComparer),
|
|
237
|
+
onRelease: set => set.Clear()
|
|
238
|
+
)
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/// <summary>
|
|
243
|
+
/// Checks if a HashSet pool has been created for the specified equality comparer.
|
|
244
|
+
/// </summary>
|
|
245
|
+
/// <param name="comparer">The equality comparer to check for.</param>
|
|
246
|
+
/// <returns>True if a pool exists for this comparer; otherwise, false.</returns>
|
|
247
|
+
/// <exception cref="ArgumentNullException">Thrown when comparer is null.</exception>
|
|
248
|
+
public static bool HasHashSetPool(IEqualityComparer<T> comparer)
|
|
249
|
+
{
|
|
250
|
+
if (comparer == null)
|
|
251
|
+
{
|
|
252
|
+
throw new ArgumentNullException(nameof(comparer));
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return HashSetCache.ContainsKey(comparer);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/// <summary>
|
|
259
|
+
/// Checks if a SortedSet pool has been created for the specified comparer.
|
|
260
|
+
/// </summary>
|
|
261
|
+
/// <param name="comparer">The comparer to check for.</param>
|
|
262
|
+
/// <returns>True if a pool exists for this comparer; otherwise, false.</returns>
|
|
263
|
+
/// <exception cref="ArgumentNullException">Thrown when comparer is null.</exception>
|
|
264
|
+
public static bool HasSortedSetPool(IComparer<T> comparer)
|
|
265
|
+
{
|
|
266
|
+
if (comparer == null)
|
|
267
|
+
{
|
|
268
|
+
throw new ArgumentNullException(nameof(comparer));
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return SortedSetCache.ContainsKey(comparer);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/// <summary>
|
|
275
|
+
/// Destroys the HashSet pool associated with the specified equality comparer and disposes of all pooled instances.
|
|
276
|
+
/// </summary>
|
|
277
|
+
/// <param name="comparer">The equality comparer whose pool should be destroyed.</param>
|
|
278
|
+
/// <returns>True if the pool was found and destroyed; false if no pool existed for this comparer.</returns>
|
|
279
|
+
/// <exception cref="ArgumentNullException">Thrown when comparer is null.</exception>
|
|
280
|
+
public static bool DestroyHashSetPool(IEqualityComparer<T> comparer)
|
|
281
|
+
{
|
|
282
|
+
if (comparer == null)
|
|
283
|
+
{
|
|
284
|
+
throw new ArgumentNullException(nameof(comparer));
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (!HashSetCache.TryRemove(comparer, out WallstopGenericPool<HashSet<T>> pool))
|
|
288
|
+
{
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
pool.Dispose();
|
|
292
|
+
return true;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/// <summary>
|
|
296
|
+
/// Destroys the SortedSet pool associated with the specified comparer and disposes of all pooled instances.
|
|
297
|
+
/// </summary>
|
|
298
|
+
/// <param name="comparer">The comparer whose pool should be destroyed.</param>
|
|
299
|
+
/// <returns>True if the pool was found and destroyed; false if no pool existed for this comparer.</returns>
|
|
300
|
+
/// <exception cref="ArgumentNullException">Thrown when comparer is null.</exception>
|
|
301
|
+
public static bool DestroySortedSetPool(IComparer<T> comparer)
|
|
302
|
+
{
|
|
303
|
+
if (comparer == null)
|
|
304
|
+
{
|
|
305
|
+
throw new ArgumentNullException(nameof(comparer));
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if (!SortedSetCache.TryRemove(comparer, out WallstopGenericPool<SortedSet<T>> pool))
|
|
309
|
+
{
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
pool.Dispose();
|
|
313
|
+
return true;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/// <summary>
|
|
318
|
+
/// Provides a thread-safe generic pool for LinkedList instances.
|
|
319
|
+
/// </summary>
|
|
320
|
+
/// <typeparam name="T">The element type for the linked list.</typeparam>
|
|
321
|
+
public static class LinkedListBuffer<T>
|
|
322
|
+
{
|
|
323
|
+
/// <summary>
|
|
324
|
+
/// Generic pool for LinkedList<T> instances. Lists are automatically cleared when returned to the pool.
|
|
325
|
+
/// </summary>
|
|
326
|
+
public static readonly WallstopGenericPool<LinkedList<T>> LinkedList = new(
|
|
327
|
+
() => new LinkedList<T>(),
|
|
328
|
+
onRelease: linkedList => linkedList.Clear()
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/// <summary>
|
|
333
|
+
/// Provides thread-safe generic pools for dictionary types with custom comparers.
|
|
334
|
+
/// Includes factory methods to create pools with custom equality and comparison logic.
|
|
335
|
+
/// </summary>
|
|
336
|
+
/// <typeparam name="TKey">The key type for the dictionaries.</typeparam>
|
|
337
|
+
/// <typeparam name="TValue">The value type for the dictionaries.</typeparam>
|
|
338
|
+
public static class DictionaryBuffer<TKey, TValue>
|
|
339
|
+
{
|
|
340
|
+
/// <summary>
|
|
341
|
+
/// Generic pool for Dictionary<TKey, TValue> instances using the default equality comparer.
|
|
342
|
+
/// Dictionaries are automatically cleared when returned to the pool.
|
|
343
|
+
/// </summary>
|
|
344
|
+
public static readonly WallstopGenericPool<Dictionary<TKey, TValue>> Dictionary = new(
|
|
345
|
+
() => new Dictionary<TKey, TValue>(),
|
|
346
|
+
onRelease: dictionary => dictionary.Clear()
|
|
347
|
+
);
|
|
348
|
+
|
|
349
|
+
/// <summary>
|
|
350
|
+
/// Generic pool for SortedDictionary<TKey, TValue> instances using the default comparer.
|
|
351
|
+
/// Dictionaries are automatically cleared when returned to the pool.
|
|
352
|
+
/// </summary>
|
|
353
|
+
public static readonly WallstopGenericPool<
|
|
354
|
+
SortedDictionary<TKey, TValue>
|
|
355
|
+
> SortedDictionary = new(
|
|
356
|
+
() => new SortedDictionary<TKey, TValue>(),
|
|
357
|
+
onRelease: sortedDictionary => sortedDictionary.Clear()
|
|
358
|
+
);
|
|
359
|
+
|
|
360
|
+
#if SINGLE_THREADED
|
|
361
|
+
private static readonly Dictionary<
|
|
362
|
+
IEqualityComparer<TKey>,
|
|
363
|
+
WallstopGenericPool<Dictionary<TKey, TValue>>
|
|
364
|
+
> DictionaryCache = new();
|
|
365
|
+
private static readonly Dictionary<
|
|
366
|
+
IComparer<TKey>,
|
|
367
|
+
WallstopGenericPool<SortedDictionary<TKey, TValue>>
|
|
368
|
+
> SortedDictionaryCache = new();
|
|
369
|
+
#else
|
|
370
|
+
private static readonly ConcurrentDictionary<
|
|
371
|
+
IEqualityComparer<TKey>,
|
|
372
|
+
WallstopGenericPool<Dictionary<TKey, TValue>>
|
|
373
|
+
> DictionaryCache = new();
|
|
374
|
+
private static readonly ConcurrentDictionary<
|
|
375
|
+
IComparer<TKey>,
|
|
376
|
+
WallstopGenericPool<SortedDictionary<TKey, TValue>>
|
|
377
|
+
> SortedDictionaryCache = new();
|
|
378
|
+
#endif
|
|
379
|
+
|
|
380
|
+
/// <summary>
|
|
381
|
+
/// Gets or creates a pool for Dictionary<TKey, TValue> instances that use the specified equality comparer.
|
|
382
|
+
/// The pool is cached and reused for subsequent calls with the same comparer instance.
|
|
383
|
+
/// </summary>
|
|
384
|
+
/// <param name="comparer">The equality comparer to use for key equality.</param>
|
|
385
|
+
/// <returns>A pool that creates Dictionary instances with the specified equality comparer.</returns>
|
|
386
|
+
/// <exception cref="ArgumentNullException">Thrown when comparer is null.</exception>
|
|
387
|
+
public static WallstopGenericPool<Dictionary<TKey, TValue>> GetDictionaryPool(
|
|
388
|
+
IEqualityComparer<TKey> comparer
|
|
389
|
+
)
|
|
390
|
+
{
|
|
391
|
+
return comparer == null
|
|
392
|
+
? throw new ArgumentNullException(nameof(comparer))
|
|
393
|
+
: DictionaryCache.GetOrAdd(
|
|
394
|
+
comparer,
|
|
395
|
+
inComparer => new WallstopGenericPool<Dictionary<TKey, TValue>>(
|
|
396
|
+
() => new Dictionary<TKey, TValue>(inComparer),
|
|
397
|
+
onRelease: dictionary => dictionary.Clear()
|
|
398
|
+
)
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/// <summary>
|
|
403
|
+
/// Gets or creates a pool for SortedDictionary<TKey, TValue> instances that use the specified comparer.
|
|
404
|
+
/// The pool is cached and reused for subsequent calls with the same comparer instance.
|
|
405
|
+
/// </summary>
|
|
406
|
+
/// <param name="comparer">The comparer to use for sorting keys.</param>
|
|
407
|
+
/// <returns>A pool that creates SortedDictionary instances with the specified comparer.</returns>
|
|
408
|
+
/// <exception cref="ArgumentNullException">Thrown when comparer is null.</exception>
|
|
409
|
+
public static WallstopGenericPool<SortedDictionary<TKey, TValue>> GetSortedDictionaryPool(
|
|
410
|
+
IComparer<TKey> comparer
|
|
411
|
+
)
|
|
412
|
+
{
|
|
413
|
+
return comparer == null
|
|
414
|
+
? throw new ArgumentNullException(nameof(comparer))
|
|
415
|
+
: SortedDictionaryCache.GetOrAdd(
|
|
416
|
+
comparer,
|
|
417
|
+
inComparer => new WallstopGenericPool<SortedDictionary<TKey, TValue>>(
|
|
418
|
+
() => new SortedDictionary<TKey, TValue>(inComparer),
|
|
419
|
+
onRelease: dictionary => dictionary.Clear()
|
|
420
|
+
)
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/// <summary>
|
|
425
|
+
/// Checks if a Dictionary pool has been created for the specified equality comparer.
|
|
426
|
+
/// </summary>
|
|
427
|
+
/// <param name="comparer">The equality comparer to check for.</param>
|
|
428
|
+
/// <returns>True if a pool exists for this comparer; otherwise, false.</returns>
|
|
429
|
+
/// <exception cref="ArgumentNullException">Thrown when comparer is null.</exception>
|
|
430
|
+
public static bool HasDictionaryPool(IEqualityComparer<TKey> comparer)
|
|
431
|
+
{
|
|
432
|
+
if (comparer == null)
|
|
433
|
+
{
|
|
434
|
+
throw new ArgumentNullException(nameof(comparer));
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
return DictionaryCache.ContainsKey(comparer);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/// <summary>
|
|
441
|
+
/// Checks if a SortedDictionary pool has been created for the specified comparer.
|
|
442
|
+
/// </summary>
|
|
443
|
+
/// <param name="comparer">The comparer to check for.</param>
|
|
444
|
+
/// <returns>True if a pool exists for this comparer; otherwise, false.</returns>
|
|
445
|
+
/// <exception cref="ArgumentNullException">Thrown when comparer is null.</exception>
|
|
446
|
+
public static bool HasSortedDictionaryPool(IComparer<TKey> comparer)
|
|
447
|
+
{
|
|
448
|
+
if (comparer == null)
|
|
449
|
+
{
|
|
450
|
+
throw new ArgumentNullException(nameof(comparer));
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
return SortedDictionaryCache.ContainsKey(comparer);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/// <summary>
|
|
457
|
+
/// Destroys the Dictionary pool associated with the specified equality comparer and disposes of all pooled instances.
|
|
458
|
+
/// </summary>
|
|
459
|
+
/// <param name="comparer">The equality comparer whose pool should be destroyed.</param>
|
|
460
|
+
/// <returns>True if the pool was found and destroyed; false if no pool existed for this comparer.</returns>
|
|
461
|
+
/// <exception cref="ArgumentNullException">Thrown when comparer is null.</exception>
|
|
462
|
+
public static bool DestroyDictionaryPool(IEqualityComparer<TKey> comparer)
|
|
463
|
+
{
|
|
464
|
+
if (comparer == null)
|
|
465
|
+
{
|
|
466
|
+
throw new ArgumentNullException(nameof(comparer));
|
|
467
|
+
}
|
|
468
|
+
if (
|
|
469
|
+
!DictionaryCache.TryRemove(
|
|
470
|
+
comparer,
|
|
471
|
+
out WallstopGenericPool<Dictionary<TKey, TValue>> pool
|
|
472
|
+
)
|
|
473
|
+
)
|
|
474
|
+
{
|
|
475
|
+
return false;
|
|
476
|
+
}
|
|
477
|
+
pool.Dispose();
|
|
478
|
+
return true;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/// <summary>
|
|
482
|
+
/// Destroys the SortedDictionary pool associated with the specified comparer and disposes of all pooled instances.
|
|
483
|
+
/// </summary>
|
|
484
|
+
/// <param name="comparer">The comparer whose pool should be destroyed.</param>
|
|
485
|
+
/// <returns>True if the pool was found and destroyed; false if no pool existed for this comparer.</returns>
|
|
486
|
+
/// <exception cref="ArgumentNullException">Thrown when comparer is null.</exception>
|
|
487
|
+
public static bool DestroySortedDictionaryPool(IComparer<TKey> comparer)
|
|
488
|
+
{
|
|
489
|
+
if (comparer == null)
|
|
490
|
+
{
|
|
491
|
+
throw new ArgumentNullException(nameof(comparer));
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
if (
|
|
495
|
+
!SortedDictionaryCache.TryRemove(
|
|
496
|
+
comparer,
|
|
497
|
+
out WallstopGenericPool<SortedDictionary<TKey, TValue>> pool
|
|
498
|
+
)
|
|
499
|
+
)
|
|
500
|
+
{
|
|
501
|
+
return false;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
pool.Dispose();
|
|
505
|
+
return true;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
#if SINGLE_THREADED
|
|
510
|
+
/// <summary>
|
|
511
|
+
/// A generic object pool that manages reusable instances of type T.
|
|
512
|
+
/// This single-threaded implementation uses a Stack for storage.
|
|
513
|
+
/// </summary>
|
|
514
|
+
/// <typeparam name="T">The type of objects to pool.</typeparam>
|
|
515
|
+
public sealed class WallstopGenericPool<T> : IDisposable
|
|
516
|
+
{
|
|
517
|
+
/// <summary>
|
|
518
|
+
/// Gets the current number of instances in the pool.
|
|
519
|
+
/// </summary>
|
|
520
|
+
internal int Count => _pool.Count;
|
|
521
|
+
|
|
522
|
+
private readonly Func<T> _producer;
|
|
523
|
+
private readonly Action<T> _onGet;
|
|
524
|
+
private readonly Action<T> _onRelease;
|
|
525
|
+
private readonly Action<T> _onDispose;
|
|
526
|
+
|
|
527
|
+
private readonly Stack<T> _pool = new();
|
|
528
|
+
|
|
529
|
+
/// <summary>
|
|
530
|
+
/// Creates a new generic pool with the specified producer function and optional callbacks.
|
|
531
|
+
/// </summary>
|
|
532
|
+
/// <param name="producer">Function that creates new instances when the pool is empty.</param>
|
|
533
|
+
/// <param name="preWarmCount">Number of instances to create and add to the pool during initialization. Default is 0.</param>
|
|
534
|
+
/// <param name="onGet">Optional callback invoked when an instance is retrieved from the pool.</param>
|
|
535
|
+
/// <param name="onRelease">Optional callback invoked when an instance is returned to the pool.</param>
|
|
536
|
+
/// <param name="onDisposal">Optional callback invoked when the pool is disposed for each pooled instance.</param>
|
|
537
|
+
/// <exception cref="ArgumentNullException">Thrown when producer is null.</exception>
|
|
538
|
+
public WallstopGenericPool(
|
|
539
|
+
Func<T> producer,
|
|
540
|
+
int preWarmCount = 0,
|
|
541
|
+
Action<T> onGet = null,
|
|
542
|
+
Action<T> onRelease = null,
|
|
543
|
+
Action<T> onDisposal = null
|
|
544
|
+
)
|
|
545
|
+
{
|
|
546
|
+
_producer = producer ?? throw new ArgumentNullException(nameof(producer));
|
|
547
|
+
_onGet = onGet;
|
|
548
|
+
_onRelease = onRelease ?? (_ => { });
|
|
549
|
+
_onRelease += _pool.Push;
|
|
550
|
+
_onDispose = onDisposal;
|
|
551
|
+
for (int i = 0; i < preWarmCount; ++i)
|
|
552
|
+
{
|
|
553
|
+
T value = _producer();
|
|
554
|
+
_onGet?.Invoke(value);
|
|
555
|
+
_onRelease(value);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/// <summary>
|
|
560
|
+
/// Gets a pooled resource. When disposed, the resource is automatically returned to the pool.
|
|
561
|
+
/// If the pool is empty, a new instance is created using the producer function.
|
|
562
|
+
/// </summary>
|
|
563
|
+
/// <returns>A PooledResource wrapping the retrieved instance.</returns>
|
|
564
|
+
public PooledResource<T> Get()
|
|
565
|
+
{
|
|
566
|
+
return Get(out _);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/// <summary>
|
|
570
|
+
/// Gets a pooled resource and outputs the value. When disposed, the resource is automatically returned to the pool.
|
|
571
|
+
/// If the pool is empty, a new instance is created using the producer function.
|
|
572
|
+
/// </summary>
|
|
573
|
+
/// <param name="value">The retrieved instance.</param>
|
|
574
|
+
/// <returns>A PooledResource wrapping the retrieved instance.</returns>
|
|
575
|
+
public PooledResource<T> Get(out T value)
|
|
576
|
+
{
|
|
577
|
+
if (!_pool.TryPop(out value))
|
|
578
|
+
{
|
|
579
|
+
value = _producer();
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
_onGet?.Invoke(value);
|
|
583
|
+
return new PooledResource<T>(value, _onRelease);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/// <summary>
|
|
587
|
+
/// Disposes the pool. If an onDisposal callback was provided, it is invoked for each pooled instance.
|
|
588
|
+
/// Otherwise, the pool is simply cleared.
|
|
589
|
+
/// </summary>
|
|
590
|
+
public void Dispose()
|
|
591
|
+
{
|
|
592
|
+
if (_onDispose == null)
|
|
593
|
+
{
|
|
594
|
+
_pool.Clear();
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
while (_pool.TryPop(out T value))
|
|
599
|
+
{
|
|
600
|
+
_onDispose(value);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
#else
|
|
605
|
+
/// <summary>
|
|
606
|
+
/// A thread-safe generic object pool that manages reusable instances of type T.
|
|
607
|
+
/// This multi-threaded implementation uses a ConcurrentStack for thread-safe storage.
|
|
608
|
+
/// </summary>
|
|
609
|
+
/// <typeparam name="T">The type of objects to pool.</typeparam>
|
|
610
|
+
public sealed class WallstopGenericPool<T> : IDisposable
|
|
611
|
+
{
|
|
612
|
+
/// <summary>
|
|
613
|
+
/// Gets the current number of instances in the pool.
|
|
614
|
+
/// </summary>
|
|
615
|
+
internal int Count => _pool.Count;
|
|
616
|
+
|
|
617
|
+
private readonly Func<T> _producer;
|
|
618
|
+
private readonly Action<T> _onGet;
|
|
619
|
+
private readonly Action<T> _onRelease;
|
|
620
|
+
private readonly Action<T> _onDispose;
|
|
621
|
+
|
|
622
|
+
private readonly ConcurrentStack<T> _pool = new();
|
|
623
|
+
|
|
624
|
+
/// <summary>
|
|
625
|
+
/// Creates a new thread-safe generic pool with the specified producer function and optional callbacks.
|
|
626
|
+
/// </summary>
|
|
627
|
+
/// <param name="producer">Function that creates new instances when the pool is empty.</param>
|
|
628
|
+
/// <param name="preWarmCount">Number of instances to create and add to the pool during initialization. Default is 0.</param>
|
|
629
|
+
/// <param name="onGet">Optional callback invoked when an instance is retrieved from the pool.</param>
|
|
630
|
+
/// <param name="onRelease">Optional callback invoked when an instance is returned to the pool.</param>
|
|
631
|
+
/// <param name="onDisposal">Optional callback invoked when the pool is disposed for each pooled instance.</param>
|
|
632
|
+
/// <exception cref="ArgumentNullException">Thrown when producer is null.</exception>
|
|
633
|
+
public WallstopGenericPool(
|
|
634
|
+
Func<T> producer,
|
|
635
|
+
int preWarmCount = 0,
|
|
636
|
+
Action<T> onGet = null,
|
|
637
|
+
Action<T> onRelease = null,
|
|
638
|
+
Action<T> onDisposal = null
|
|
639
|
+
)
|
|
640
|
+
{
|
|
641
|
+
_producer = producer ?? throw new ArgumentNullException(nameof(producer));
|
|
642
|
+
_onGet = onGet;
|
|
643
|
+
_onRelease = onRelease ?? (_ => { });
|
|
644
|
+
_onRelease += _pool.Push;
|
|
645
|
+
_onDispose = onDisposal;
|
|
646
|
+
for (int i = 0; i < preWarmCount; ++i)
|
|
647
|
+
{
|
|
648
|
+
T value = _producer();
|
|
649
|
+
_onGet?.Invoke(value);
|
|
650
|
+
_onRelease(value);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/// <summary>
|
|
655
|
+
/// Gets a pooled resource. When disposed, the resource is automatically returned to the pool.
|
|
656
|
+
/// If the pool is empty, a new instance is created using the producer function.
|
|
657
|
+
/// This method is thread-safe.
|
|
658
|
+
/// </summary>
|
|
659
|
+
/// <returns>A PooledResource wrapping the retrieved instance.</returns>
|
|
660
|
+
public PooledResource<T> Get()
|
|
661
|
+
{
|
|
662
|
+
return Get(out _);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/// <summary>
|
|
666
|
+
/// Gets a pooled resource and outputs the value. When disposed, the resource is automatically returned to the pool.
|
|
667
|
+
/// If the pool is empty, a new instance is created using the producer function.
|
|
668
|
+
/// This method is thread-safe.
|
|
669
|
+
/// </summary>
|
|
670
|
+
/// <param name="value">The retrieved instance.</param>
|
|
671
|
+
/// <returns>A PooledResource wrapping the retrieved instance.</returns>
|
|
672
|
+
public PooledResource<T> Get(out T value)
|
|
673
|
+
{
|
|
674
|
+
if (!_pool.TryPop(out value))
|
|
675
|
+
{
|
|
676
|
+
value = _producer();
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
_onGet?.Invoke(value);
|
|
680
|
+
return new PooledResource<T>(value, _onRelease);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
/// <summary>
|
|
684
|
+
/// Disposes the pool. If an onDisposal callback was provided, it is invoked for each pooled instance.
|
|
685
|
+
/// Otherwise, the pool is simply cleared.
|
|
686
|
+
/// </summary>
|
|
687
|
+
public void Dispose()
|
|
688
|
+
{
|
|
689
|
+
if (_onDispose == null)
|
|
690
|
+
{
|
|
691
|
+
_pool.Clear();
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
while (_pool.TryPop(out T value))
|
|
696
|
+
{
|
|
697
|
+
_onDispose(value);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
#endif
|
|
702
|
+
|
|
703
|
+
#if SINGLE_THREADED
|
|
704
|
+
/// <summary>
|
|
705
|
+
/// A static array pool that provides pooled arrays of specific sizes.
|
|
706
|
+
/// Arrays are cleared (set to default values) when returned to the pool.
|
|
707
|
+
/// This single-threaded implementation uses Dictionary and List for storage.
|
|
708
|
+
/// </summary>
|
|
709
|
+
/// <typeparam name="T">The element type for the arrays.</typeparam>
|
|
710
|
+
public static class WallstopArrayPool<T>
|
|
711
|
+
{
|
|
712
|
+
private static readonly Dictionary<int, List<T[]>> _pool = new();
|
|
713
|
+
private static readonly Action<T[]> _onDispose = Release;
|
|
714
|
+
|
|
715
|
+
/// <summary>
|
|
716
|
+
/// Gets a pooled array of the specified size. When disposed, the array is cleared and returned to the pool.
|
|
717
|
+
/// </summary>
|
|
718
|
+
/// <param name="size">The size of the array to retrieve. Must be non-negative.</param>
|
|
719
|
+
/// <returns>A PooledResource wrapping an array of the specified size.</returns>
|
|
720
|
+
/// <exception cref="ArgumentOutOfRangeException">Thrown when size is negative.</exception>
|
|
721
|
+
public static PooledResource<T[]> Get(int size)
|
|
722
|
+
{
|
|
723
|
+
return Get(size, out _);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/// <summary>
|
|
727
|
+
/// Gets a pooled array of the specified size and outputs the value. When disposed, the array is cleared and returned to the pool.
|
|
728
|
+
/// </summary>
|
|
729
|
+
/// <param name="size">The size of the array to retrieve. Must be non-negative.</param>
|
|
730
|
+
/// <param name="value">The retrieved array.</param>
|
|
731
|
+
/// <returns>A PooledResource wrapping an array of the specified size.</returns>
|
|
732
|
+
/// <exception cref="ArgumentOutOfRangeException">Thrown when size is negative.</exception>
|
|
733
|
+
public static PooledResource<T[]> Get(int size, out T[] value)
|
|
734
|
+
{
|
|
735
|
+
switch (size)
|
|
736
|
+
{
|
|
737
|
+
case < 0:
|
|
738
|
+
{
|
|
739
|
+
throw new ArgumentOutOfRangeException(
|
|
740
|
+
nameof(size),
|
|
741
|
+
size,
|
|
742
|
+
"Must be non-negative."
|
|
743
|
+
);
|
|
744
|
+
}
|
|
745
|
+
case 0:
|
|
746
|
+
{
|
|
747
|
+
value = Array.Empty<T>();
|
|
748
|
+
return new PooledResource<T[]>(value, _ => { });
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
if (!_pool.TryGetValue(size, out List<T[]> pool))
|
|
753
|
+
{
|
|
754
|
+
pool = new List<T[]>();
|
|
755
|
+
_pool[size] = pool;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
if (pool.Count == 0)
|
|
759
|
+
{
|
|
760
|
+
value = new T[size];
|
|
761
|
+
return new PooledResource<T[]>(value, _onDispose);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
int lastIndex = pool.Count - 1;
|
|
765
|
+
value = pool[lastIndex];
|
|
766
|
+
pool.RemoveAt(lastIndex);
|
|
767
|
+
return new PooledResource<T[]>(value, _onDispose);
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
private static void Release(T[] resource)
|
|
771
|
+
{
|
|
772
|
+
int length = resource.Length;
|
|
773
|
+
Array.Clear(resource, 0, length);
|
|
774
|
+
if (!_pool.TryGetValue(length, out List<T[]> pool))
|
|
775
|
+
{
|
|
776
|
+
pool = new List<T[]>();
|
|
777
|
+
_pool[resource.Length] = pool;
|
|
778
|
+
}
|
|
779
|
+
pool.Add(resource);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
#else
|
|
783
|
+
/// <summary>
|
|
784
|
+
/// A thread-safe static array pool that provides pooled arrays of specific sizes.
|
|
785
|
+
/// Arrays are cleared (set to default values) when returned to the pool.
|
|
786
|
+
/// This multi-threaded implementation uses ConcurrentDictionary and ConcurrentStack for thread-safe storage.
|
|
787
|
+
/// </summary>
|
|
788
|
+
/// <typeparam name="T">The element type for the arrays.</typeparam>
|
|
789
|
+
public static class WallstopArrayPool<T>
|
|
790
|
+
{
|
|
791
|
+
private static readonly ConcurrentDictionary<int, ConcurrentStack<T[]>> _pool = new();
|
|
792
|
+
private static readonly Action<T[]> _onRelease = Release;
|
|
793
|
+
|
|
794
|
+
/// <summary>
|
|
795
|
+
/// Gets a pooled array of the specified size. When disposed, the array is cleared and returned to the pool.
|
|
796
|
+
/// This method is thread-safe.
|
|
797
|
+
/// </summary>
|
|
798
|
+
/// <param name="size">The size of the array to retrieve. Must be non-negative.</param>
|
|
799
|
+
/// <returns>A PooledResource wrapping an array of the specified size.</returns>
|
|
800
|
+
/// <exception cref="ArgumentOutOfRangeException">Thrown when size is negative.</exception>
|
|
801
|
+
public static PooledResource<T[]> Get(int size)
|
|
802
|
+
{
|
|
803
|
+
return Get(size, out _);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
/// <summary>
|
|
807
|
+
/// Gets a pooled array of the specified size and outputs the value. When disposed, the array is cleared and returned to the pool.
|
|
808
|
+
/// This method is thread-safe.
|
|
809
|
+
/// </summary>
|
|
810
|
+
/// <param name="size">The size of the array to retrieve. Must be non-negative.</param>
|
|
811
|
+
/// <param name="value">The retrieved array.</param>
|
|
812
|
+
/// <returns>A PooledResource wrapping an array of the specified size.</returns>
|
|
813
|
+
/// <exception cref="ArgumentOutOfRangeException">Thrown when size is negative.</exception>
|
|
814
|
+
public static PooledResource<T[]> Get(int size, out T[] value)
|
|
815
|
+
{
|
|
816
|
+
switch (size)
|
|
817
|
+
{
|
|
818
|
+
case < 0:
|
|
819
|
+
{
|
|
820
|
+
throw new ArgumentOutOfRangeException(
|
|
821
|
+
nameof(size),
|
|
822
|
+
size,
|
|
823
|
+
"Must be non-negative."
|
|
824
|
+
);
|
|
825
|
+
}
|
|
826
|
+
case 0:
|
|
827
|
+
{
|
|
828
|
+
value = Array.Empty<T>();
|
|
829
|
+
return new PooledResource<T[]>(value, _ => { });
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
ConcurrentStack<T[]> result = _pool.GetOrAdd(size, _ => new ConcurrentStack<T[]>());
|
|
834
|
+
if (!result.TryPop(out value))
|
|
835
|
+
{
|
|
836
|
+
value = new T[size];
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
return new PooledResource<T[]>(value, _onRelease);
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
private static void Release(T[] resource)
|
|
843
|
+
{
|
|
844
|
+
int length = resource.Length;
|
|
845
|
+
Array.Clear(resource, 0, length);
|
|
846
|
+
ConcurrentStack<T[]> result = _pool.GetOrAdd(length, _ => new ConcurrentStack<T[]>());
|
|
847
|
+
result.Push(resource);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
#endif
|
|
851
|
+
|
|
852
|
+
#if SINGLE_THREADED
|
|
853
|
+
/// <summary>
|
|
854
|
+
/// A fast static array pool optimized for index-based lookup with minimal overhead.
|
|
855
|
+
/// Unlike WallstopArrayPool, arrays are NOT cleared when returned to the pool, providing better performance.
|
|
856
|
+
/// This single-threaded implementation uses a List of Stacks indexed by array size for O(1) lookups.
|
|
857
|
+
/// </summary>
|
|
858
|
+
/// <typeparam name="T">The element type for the arrays.</typeparam>
|
|
859
|
+
/// <remarks>
|
|
860
|
+
/// IMPORTANT: This pool does NOT clear arrays on release. Callers must manually clear arrays if needed.
|
|
861
|
+
/// This design trades safety for performance in scenarios where array contents don't need to be reset.
|
|
862
|
+
/// </remarks>
|
|
863
|
+
public static class WallstopFastArrayPool<T>
|
|
864
|
+
{
|
|
865
|
+
private static readonly List<Stack<T[]>> _pool = new();
|
|
866
|
+
private static readonly Action<T[]> _onRelease = Release;
|
|
867
|
+
|
|
868
|
+
/// <summary>
|
|
869
|
+
/// Gets a pooled array of the specified size. When disposed, the array is returned to the pool WITHOUT being cleared.
|
|
870
|
+
/// </summary>
|
|
871
|
+
/// <param name="size">The size of the array to retrieve. Must be non-negative.</param>
|
|
872
|
+
/// <returns>A PooledResource wrapping an array of the specified size.</returns>
|
|
873
|
+
/// <exception cref="ArgumentOutOfRangeException">Thrown when size is negative.</exception>
|
|
874
|
+
/// <remarks>Arrays are NOT cleared on return. The caller is responsible for clearing if needed.</remarks>
|
|
875
|
+
public static PooledResource<T[]> Get(int size)
|
|
876
|
+
{
|
|
877
|
+
return Get(size, out _);
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
/// <summary>
|
|
881
|
+
/// Gets a pooled array of the specified size and outputs the value. When disposed, the array is returned to the pool WITHOUT being cleared.
|
|
882
|
+
/// </summary>
|
|
883
|
+
/// <param name="size">The size of the array to retrieve. Must be non-negative.</param>
|
|
884
|
+
/// <param name="value">The retrieved array.</param>
|
|
885
|
+
/// <returns>A PooledResource wrapping an array of the specified size.</returns>
|
|
886
|
+
/// <exception cref="ArgumentOutOfRangeException">Thrown when size is negative.</exception>
|
|
887
|
+
/// <remarks>Arrays are NOT cleared on return. The caller is responsible for clearing if needed.</remarks>
|
|
888
|
+
public static PooledResource<T[]> Get(int size, out T[] value)
|
|
889
|
+
{
|
|
890
|
+
switch (size)
|
|
891
|
+
{
|
|
892
|
+
case < 0:
|
|
893
|
+
{
|
|
894
|
+
throw new ArgumentOutOfRangeException(
|
|
895
|
+
nameof(size),
|
|
896
|
+
size,
|
|
897
|
+
"Must be non-negative."
|
|
898
|
+
);
|
|
899
|
+
}
|
|
900
|
+
case 0:
|
|
901
|
+
{
|
|
902
|
+
value = Array.Empty<T>();
|
|
903
|
+
return new PooledResource<T[]>(value, _ => { });
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
while (_pool.Count <= size)
|
|
908
|
+
{
|
|
909
|
+
_pool.Add(null);
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
Stack<T[]> pool = _pool[size];
|
|
913
|
+
if (pool == null)
|
|
914
|
+
{
|
|
915
|
+
pool = new Stack<T[]>();
|
|
916
|
+
_pool[size] = pool;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
if (!pool.TryPop(out value))
|
|
920
|
+
{
|
|
921
|
+
value = new T[size];
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
return new PooledResource<T[]>(value, _onRelease);
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
private static void Release(T[] resource)
|
|
928
|
+
{
|
|
929
|
+
_pool[resource.Length].Push(resource);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
#else
|
|
933
|
+
/// <summary>
|
|
934
|
+
/// A thread-safe fast static array pool optimized for index-based lookup with minimal overhead.
|
|
935
|
+
/// Unlike WallstopArrayPool, arrays are NOT cleared when returned to the pool, providing better performance.
|
|
936
|
+
/// This multi-threaded implementation uses a List of ConcurrentStacks with ReaderWriterLockSlim for thread-safe index access.
|
|
937
|
+
/// </summary>
|
|
938
|
+
/// <typeparam name="T">The element type for the arrays.</typeparam>
|
|
939
|
+
/// <remarks>
|
|
940
|
+
/// IMPORTANT: This pool does NOT clear arrays on release. Callers must manually clear arrays if needed.
|
|
941
|
+
/// This design trades safety for performance in scenarios where array contents don't need to be reset.
|
|
942
|
+
/// </remarks>
|
|
943
|
+
public static class WallstopFastArrayPool<T>
|
|
944
|
+
{
|
|
945
|
+
private static readonly ReaderWriterLockSlim _lock = new();
|
|
946
|
+
private static readonly List<ConcurrentStack<T[]>> _pool = new();
|
|
947
|
+
private static readonly Action<T[]> _onRelease = Release;
|
|
948
|
+
|
|
949
|
+
/// <summary>
|
|
950
|
+
/// Gets a pooled array of the specified size. When disposed, the array is returned to the pool WITHOUT being cleared.
|
|
951
|
+
/// This method is thread-safe.
|
|
952
|
+
/// </summary>
|
|
953
|
+
/// <param name="size">The size of the array to retrieve. Must be non-negative.</param>
|
|
954
|
+
/// <returns>A PooledResource wrapping an array of the specified size.</returns>
|
|
955
|
+
/// <exception cref="ArgumentOutOfRangeException">Thrown when size is negative.</exception>
|
|
956
|
+
/// <remarks>Arrays are NOT cleared on return. The caller is responsible for clearing if needed.</remarks>
|
|
957
|
+
public static PooledResource<T[]> Get(int size)
|
|
958
|
+
{
|
|
959
|
+
return Get(size, out _);
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
/// <summary>
|
|
963
|
+
/// Gets a pooled array of the specified size and outputs the value. When disposed, the array is returned to the pool WITHOUT being cleared.
|
|
964
|
+
/// This method is thread-safe.
|
|
965
|
+
/// </summary>
|
|
966
|
+
/// <param name="size">The size of the array to retrieve. Must be non-negative.</param>
|
|
967
|
+
/// <param name="value">The retrieved array.</param>
|
|
968
|
+
/// <returns>A PooledResource wrapping an array of the specified size.</returns>
|
|
969
|
+
/// <exception cref="ArgumentOutOfRangeException">Thrown when size is negative.</exception>
|
|
970
|
+
/// <remarks>Arrays are NOT cleared on return. The caller is responsible for clearing if needed.</remarks>
|
|
971
|
+
public static PooledResource<T[]> Get(int size, out T[] value)
|
|
972
|
+
{
|
|
973
|
+
switch (size)
|
|
974
|
+
{
|
|
975
|
+
case < 0:
|
|
976
|
+
{
|
|
977
|
+
throw new ArgumentOutOfRangeException(
|
|
978
|
+
nameof(size),
|
|
979
|
+
size,
|
|
980
|
+
"Must be non-negative."
|
|
981
|
+
);
|
|
982
|
+
}
|
|
983
|
+
case 0:
|
|
984
|
+
{
|
|
985
|
+
value = Array.Empty<T>();
|
|
986
|
+
return new PooledResource<T[]>(value, _ => { });
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
bool withinRange;
|
|
991
|
+
ConcurrentStack<T[]> pool = null;
|
|
992
|
+
_lock.EnterReadLock();
|
|
993
|
+
try
|
|
994
|
+
{
|
|
995
|
+
withinRange = size < _pool.Count;
|
|
996
|
+
if (withinRange)
|
|
997
|
+
{
|
|
998
|
+
pool = _pool[size];
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
finally
|
|
1002
|
+
{
|
|
1003
|
+
_lock.ExitReadLock();
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
if (withinRange)
|
|
1007
|
+
{
|
|
1008
|
+
if (pool == null)
|
|
1009
|
+
{
|
|
1010
|
+
_lock.EnterUpgradeableReadLock();
|
|
1011
|
+
try
|
|
1012
|
+
{
|
|
1013
|
+
pool = _pool[size];
|
|
1014
|
+
if (pool == null)
|
|
1015
|
+
{
|
|
1016
|
+
_lock.EnterWriteLock();
|
|
1017
|
+
try
|
|
1018
|
+
{
|
|
1019
|
+
pool = _pool[size];
|
|
1020
|
+
if (pool == null)
|
|
1021
|
+
{
|
|
1022
|
+
pool = new ConcurrentStack<T[]>();
|
|
1023
|
+
_pool[size] = pool;
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
finally
|
|
1027
|
+
{
|
|
1028
|
+
_lock.ExitWriteLock();
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
finally
|
|
1033
|
+
{
|
|
1034
|
+
_lock.ExitUpgradeableReadLock();
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
else
|
|
1039
|
+
{
|
|
1040
|
+
_lock.EnterUpgradeableReadLock();
|
|
1041
|
+
try
|
|
1042
|
+
{
|
|
1043
|
+
if (size < _pool.Count)
|
|
1044
|
+
{
|
|
1045
|
+
pool = _pool[size];
|
|
1046
|
+
if (pool == null)
|
|
1047
|
+
{
|
|
1048
|
+
_lock.EnterWriteLock();
|
|
1049
|
+
try
|
|
1050
|
+
{
|
|
1051
|
+
pool = _pool[size];
|
|
1052
|
+
if (pool == null)
|
|
1053
|
+
{
|
|
1054
|
+
pool = new ConcurrentStack<T[]>();
|
|
1055
|
+
_pool[size] = pool;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
finally
|
|
1059
|
+
{
|
|
1060
|
+
_lock.ExitWriteLock();
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
else
|
|
1065
|
+
{
|
|
1066
|
+
_lock.EnterWriteLock();
|
|
1067
|
+
try
|
|
1068
|
+
{
|
|
1069
|
+
while (_pool.Count <= size)
|
|
1070
|
+
{
|
|
1071
|
+
_pool.Add(null);
|
|
1072
|
+
}
|
|
1073
|
+
pool = _pool[size];
|
|
1074
|
+
if (pool == null)
|
|
1075
|
+
{
|
|
1076
|
+
pool = new ConcurrentStack<T[]>();
|
|
1077
|
+
_pool[size] = pool;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
finally
|
|
1081
|
+
{
|
|
1082
|
+
_lock.ExitWriteLock();
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
finally
|
|
1087
|
+
{
|
|
1088
|
+
_lock.ExitUpgradeableReadLock();
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
if (!pool.TryPop(out value))
|
|
1093
|
+
{
|
|
1094
|
+
value = new T[size];
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
return new PooledResource<T[]>(value, _onRelease);
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
private static void Release(T[] resource)
|
|
1101
|
+
{
|
|
1102
|
+
_pool[resource.Length].Push(resource);
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
#endif
|
|
1106
|
+
|
|
1107
|
+
/// <summary>
|
|
1108
|
+
/// A readonly struct that wraps a pooled resource and automatically returns it to the pool when disposed.
|
|
1109
|
+
/// This type is designed to be used with 'using' statements to ensure resources are properly returned.
|
|
1110
|
+
/// </summary>
|
|
1111
|
+
/// <typeparam name="T">The type of the pooled resource.</typeparam>
|
|
1112
|
+
/// <remarks>
|
|
1113
|
+
/// This struct implements IDisposable to enable automatic resource return via 'using' statements.
|
|
1114
|
+
/// The resource is returned to its pool when Dispose is called, typically at the end of a 'using' block.
|
|
1115
|
+
/// </remarks>
|
|
1116
|
+
public readonly struct PooledResource<T> : IDisposable
|
|
1117
|
+
{
|
|
1118
|
+
/// <summary>
|
|
1119
|
+
/// The pooled resource instance. Access this to use the resource.
|
|
1120
|
+
/// </summary>
|
|
1121
|
+
public readonly T resource;
|
|
1122
|
+
private readonly Action<T> _onDispose;
|
|
1123
|
+
private readonly bool _initialized;
|
|
1124
|
+
|
|
1125
|
+
/// <summary>
|
|
1126
|
+
/// Creates a new PooledResource wrapping the specified resource with a disposal action.
|
|
1127
|
+
/// </summary>
|
|
1128
|
+
/// <param name="resource">The resource to wrap.</param>
|
|
1129
|
+
/// <param name="onDispose">The action to invoke when disposing, typically returning the resource to a pool.</param>
|
|
1130
|
+
internal PooledResource(T resource, Action<T> onDispose)
|
|
1131
|
+
{
|
|
1132
|
+
_initialized = true;
|
|
1133
|
+
this.resource = resource;
|
|
1134
|
+
_onDispose = onDispose;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
/// <summary>
|
|
1138
|
+
/// Disposes the resource by invoking the disposal action, typically returning it to the pool.
|
|
1139
|
+
/// This method is automatically called at the end of a 'using' block.
|
|
1140
|
+
/// </summary>
|
|
1141
|
+
public void Dispose()
|
|
1142
|
+
{
|
|
1143
|
+
if (!_initialized)
|
|
1144
|
+
{
|
|
1145
|
+
return;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
_onDispose(resource);
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
}
|