com.wallstop-studios.unity-helpers 2.0.0-rc81.7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1500) hide show
  1. package/.config/dotnet-tools.json +10 -10
  2. package/.csharpierignore +1 -0
  3. package/.csharpierrc.json +3 -0
  4. package/.editorconfig +184 -184
  5. package/.gitattributes +87 -63
  6. package/.githooks/pre-commit +75 -0
  7. package/.githooks/pre-push +50 -0
  8. package/.github/dependabot.yml +32 -10
  9. package/.github/scripts/check-markdown-links.ps1 +77 -0
  10. package/.github/scripts/check_markdown_links.py +89 -0
  11. package/.github/scripts/check_markdown_url_encoding.py +74 -0
  12. package/.github/scripts/validate_markdown_links.py +194 -0
  13. package/.github/workflows/csharpier-autofix.yml +152 -0
  14. package/.github/workflows/format-on-demand.yml +305 -0
  15. package/.github/workflows/lint-doc-links.yml +30 -0
  16. package/.github/workflows/markdown-json.yml +45 -0
  17. package/.github/workflows/npm-publish.yml +75 -75
  18. package/.github/workflows/prettier-autofix.yml +195 -0
  19. package/.github/workflows/update-dotnet-tools.yml +80 -0
  20. package/.github/workflows/yaml-format-lint.yml +41 -0
  21. package/.lychee.toml +26 -0
  22. package/.markdownlint.json +21 -0
  23. package/.markdownlint.jsonc +21 -0
  24. package/.markdownlintignore +8 -0
  25. package/.pre-commit-config.yaml +47 -22
  26. package/.prettierignore +22 -0
  27. package/.prettierrc.json +20 -0
  28. package/.yamllint.yaml +31 -0
  29. package/AGENTS.md +56 -0
  30. package/{Third Party Notices.md.meta → AGENTS.md.meta} +7 -7
  31. package/CHANGELOG.md +11 -0
  32. package/CHANGELOG.md.meta +7 -7
  33. package/CONTRIBUTING.md +49 -0
  34. package/CONTRIBUTING.md.meta +7 -0
  35. package/DATA_STRUCTURES.md +324 -0
  36. package/DATA_STRUCTURES.md.meta +7 -0
  37. package/Docs/Images/attribute_resolution.svg +40 -0
  38. package/Docs/Images/attribute_resolution.svg.meta +7 -0
  39. package/Docs/Images/bitset.svg +47 -0
  40. package/Docs/Images/bitset.svg.meta +7 -0
  41. package/Docs/Images/concave_hull.svg +30 -0
  42. package/Docs/Images/concave_hull.svg.meta +7 -0
  43. package/Docs/Images/convex_hull.svg +29 -0
  44. package/Docs/Images/convex_hull.svg.meta +7 -0
  45. package/Docs/Images/cyclic_buffer.svg +37 -0
  46. package/Docs/Images/cyclic_buffer.svg.meta +7 -0
  47. package/Docs/Images/data_distribution_decision.svg +88 -0
  48. package/Docs/Images/data_distribution_decision.svg.meta +7 -0
  49. package/Docs/Images/deque.svg +64 -0
  50. package/Docs/Images/deque.svg.meta +7 -0
  51. package/Docs/Images/deque_queue.svg +107 -0
  52. package/Docs/Images/deque_queue.svg.meta +7 -0
  53. package/Docs/Images/disjoint_set.svg +47 -0
  54. package/Docs/Images/disjoint_set.svg.meta +7 -0
  55. package/Docs/Images/effects_pipeline.svg +59 -0
  56. package/Docs/Images/effects_pipeline.svg.meta +7 -0
  57. package/Docs/Images/geometry_edge_cases.svg +61 -0
  58. package/Docs/Images/geometry_edge_cases.svg.meta +7 -0
  59. package/Docs/Images/heap.svg +56 -0
  60. package/Docs/Images/heap.svg.meta +7 -0
  61. package/Docs/Images/kdtree_2d.svg +38 -0
  62. package/Docs/Images/kdtree_2d.svg.meta +7 -0
  63. package/Docs/Images/kdtree_3d.svg +83 -0
  64. package/Docs/Images/kdtree_3d.svg.meta +7 -0
  65. package/Docs/Images/octree_3d.svg +79 -0
  66. package/Docs/Images/octree_3d.svg.meta +7 -0
  67. package/Docs/Images/polyline_simplify.svg +18 -0
  68. package/Docs/Images/polyline_simplify.svg.meta +7 -0
  69. package/Docs/Images/quadtree_2d.svg +37 -0
  70. package/Docs/Images/quadtree_2d.svg.meta +7 -0
  71. package/Docs/Images/query_boundaries.svg +38 -0
  72. package/Docs/Images/query_boundaries.svg.meta +7 -0
  73. package/Docs/Images/random_generators.svg +105 -0
  74. package/Docs/Images/random_generators.svg.meta +7 -0
  75. package/Docs/Images/reflection_scan.svg +33 -0
  76. package/Docs/Images/reflection_scan.svg.meta +7 -0
  77. package/Docs/Images/relational_wiring.svg +75 -0
  78. package/Docs/Images/relational_wiring.svg.meta +7 -0
  79. package/Docs/Images/rtree_2d.svg +27 -0
  80. package/Docs/Images/rtree_2d.svg.meta +7 -0
  81. package/Docs/Images/rtree_3d.svg +79 -0
  82. package/Docs/Images/rtree_3d.svg.meta +7 -0
  83. package/Docs/Images/serialization_flow.svg +50 -0
  84. package/Docs/Images/serialization_flow.svg.meta +7 -0
  85. package/Docs/Images/singletons_lifecycle.svg +54 -0
  86. package/Docs/Images/singletons_lifecycle.svg.meta +7 -0
  87. package/Docs/Images/sparse_set.svg +54 -0
  88. package/Docs/Images/sparse_set.svg.meta +7 -0
  89. package/Docs/Images/trie.svg +55 -0
  90. package/Docs/Images/trie.svg.meta +7 -0
  91. package/Docs/Images.meta +8 -0
  92. package/Docs.meta +8 -0
  93. package/EDITOR_TOOLS_GUIDE.md +1980 -0
  94. package/EDITOR_TOOLS_GUIDE.md.meta +7 -0
  95. package/EFFECTS_SYSTEM.md +242 -0
  96. package/EFFECTS_SYSTEM.md.meta +7 -0
  97. package/EFFECTS_SYSTEM_TUTORIAL.md +467 -0
  98. package/EFFECTS_SYSTEM_TUTORIAL.md.meta +7 -0
  99. package/Editor/AnimationEventEditor.cs +1570 -874
  100. package/Editor/AnimationEventEditor.cs.meta +11 -11
  101. package/Editor/AssemblyInfo.cs +4 -0
  102. package/Editor/AssemblyInfo.cs.meta +3 -0
  103. package/Editor/AssetProcessors/SpriteLabelProcessor.cs +138 -111
  104. package/Editor/AssetProcessors/SpriteLabelProcessor.cs.meta +2 -2
  105. package/Editor/AssetProcessors.meta +2 -2
  106. package/Editor/Core/Helper/AnimationEventHelpers.cs +230 -0
  107. package/{Runtime/Core/DataStructure/ISpatialTree.cs.meta → Editor/Core/Helper/AnimationEventHelpers.cs.meta} +11 -11
  108. package/Editor/Core/Helper.meta +8 -0
  109. package/Editor/Core.meta +8 -0
  110. package/Editor/CustomDrawers/IntDropdownDrawer.cs +46 -46
  111. package/Editor/CustomDrawers/IntDropdownDrawer.cs.meta +2 -2
  112. package/Editor/CustomDrawers/StringInListeDrawer.cs +135 -135
  113. package/Editor/CustomDrawers/StringInListeDrawer.cs.meta +2 -2
  114. package/Editor/CustomDrawers/WShowIfPropertyDrawer.cs +105 -105
  115. package/Editor/CustomDrawers/WShowIfPropertyDrawer.cs.meta +2 -2
  116. package/Editor/CustomDrawers.meta +2 -2
  117. package/Editor/CustomEditors/MatchColliderToSpriteEditor.cs +32 -32
  118. package/Editor/CustomEditors/MatchColliderToSpriteEditor.cs.meta +2 -2
  119. package/Editor/CustomEditors/PersistentDirectoryGUI.cs +808 -799
  120. package/Editor/CustomEditors/PersistentDirectoryGUI.cs.meta +2 -2
  121. package/Editor/CustomEditors/PolygonCollider2DOptimizerEditor.cs +38 -40
  122. package/Editor/CustomEditors/PolygonCollider2DOptimizerEditor.cs.meta +2 -2
  123. package/Editor/CustomEditors/SourceFolderEntryDrawer.cs +685 -413
  124. package/Editor/CustomEditors/SourceFolderEntryDrawer.cs.meta +2 -2
  125. package/Editor/CustomEditors/TexturePlatformOverrideEntryDrawer.cs +155 -0
  126. package/{Runtime/Core/DataStructure/KDTree.cs.meta → Editor/CustomEditors/TexturePlatformOverrideEntryDrawer.cs.meta} +11 -11
  127. package/Editor/CustomEditors.meta +2 -2
  128. package/Editor/Extensions/SerializedPropertyExtensions.cs +217 -190
  129. package/Editor/Extensions/SerializedPropertyExtensions.cs.meta +2 -2
  130. package/Editor/Extensions/UnityExtensions.cs +50 -26
  131. package/Editor/Extensions/UnityExtensions.cs.meta +2 -2
  132. package/Editor/Extensions.meta +2 -2
  133. package/Editor/FitTextureSizeWindow.cs +809 -332
  134. package/Editor/FitTextureSizeWindow.cs.meta +2 -2
  135. package/Editor/Persistence/MultiFileSelectorPersistenceManager.cs +62 -0
  136. package/{Runtime/Core/DataStructure/QuadTree.cs.meta → Editor/Persistence/MultiFileSelectorPersistenceManager.cs.meta} +11 -11
  137. package/Editor/Persistence/MultiFileSelectorPersistenceWindow.cs +65 -0
  138. package/Editor/Persistence/MultiFileSelectorPersistenceWindow.cs.meta +11 -0
  139. package/Editor/Persistence.meta +8 -0
  140. package/Editor/PersistentDirectorySettings.cs +581 -248
  141. package/Editor/PersistentDirectorySettings.cs.meta +2 -2
  142. package/Editor/PrefabChecker.cs +1396 -741
  143. package/Editor/PrefabChecker.cs.meta +11 -11
  144. package/Editor/Sprites/AnimationCopier.cs +1594 -789
  145. package/Editor/Sprites/AnimationCopier.cs.meta +2 -2
  146. package/Editor/Sprites/AnimationCreator.cs +1573 -881
  147. package/Editor/Sprites/AnimationCreator.cs.meta +11 -11
  148. package/Editor/Sprites/AnimationViewerWindow.cs +1670 -1522
  149. package/Editor/Sprites/AnimationViewerWindow.cs.meta +2 -2
  150. package/Editor/Sprites/ScriptableSpriteAtlas.cs +251 -178
  151. package/Editor/Sprites/ScriptableSpriteAtlas.cs.meta +2 -2
  152. package/Editor/Sprites/ScriptableSpriteAtlasEditor.cs +1470 -1026
  153. package/Editor/Sprites/ScriptableSpriteAtlasEditor.cs.meta +2 -2
  154. package/Editor/Sprites/SpriteCropper.cs +1013 -523
  155. package/Editor/Sprites/SpriteCropper.cs.meta +2 -2
  156. package/Editor/Sprites/SpritePivotAdjustor.cs +605 -265
  157. package/Editor/Sprites/SpritePivotAdjustor.cs.meta +2 -2
  158. package/Editor/Sprites/SpriteSettingsApplier.cs +942 -918
  159. package/Editor/Sprites/SpriteSettingsApplier.cs.meta +2 -2
  160. package/Editor/Sprites/SpriteSettingsApplierAPI.cs +441 -0
  161. package/Editor/Sprites/SpriteSettingsApplierAPI.cs.meta +11 -0
  162. package/Editor/Sprites/SpriteSettingsProfileCollection.cs +12 -0
  163. package/Editor/Sprites/SpriteSettingsProfileCollection.cs.meta +11 -0
  164. package/Editor/Sprites/SpriteSheetAnimationCreator.cs +1586 -1537
  165. package/Editor/Sprites/SpriteSheetAnimationCreator.cs.meta +2 -2
  166. package/Editor/Sprites/TexturePlatformNameHelper.cs +89 -0
  167. package/Editor/Sprites/TexturePlatformNameHelper.cs.meta +11 -0
  168. package/Editor/Sprites/TextureResizerWizard.cs +456 -175
  169. package/Editor/Sprites/TextureResizerWizard.cs.meta +2 -2
  170. package/Editor/Sprites/TextureSettingsApplierAPI.cs +359 -0
  171. package/Editor/Sprites/TextureSettingsApplierAPI.cs.meta +11 -0
  172. package/Editor/Sprites/TextureSettingsApplierWindow.cs +668 -0
  173. package/Editor/Sprites/TextureSettingsApplierWindow.cs.meta +11 -0
  174. package/Editor/Sprites.meta +2 -2
  175. package/Editor/Styles/AnimationViewer.uss +115 -115
  176. package/Editor/Styles/AnimationViewer.uss.meta +2 -2
  177. package/Editor/Styles/AnimationViewer.uxml +56 -56
  178. package/Editor/Styles/AnimationViewer.uxml.meta +2 -2
  179. package/Editor/Styles/SpriteSheetAnimationCreator.uss +10 -0
  180. package/Editor/Styles/SpriteSheetAnimationCreator.uss.meta +11 -0
  181. package/Editor/Styles.meta +2 -2
  182. package/Editor/Tags/AttributeMetadataCacheEditor.cs +46 -0
  183. package/Editor/Tags/AttributeMetadataCacheEditor.cs.meta +11 -0
  184. package/Editor/Tags/AttributeMetadataCacheGenerator.cs +258 -0
  185. package/Editor/Tags/AttributeMetadataCacheGenerator.cs.meta +11 -0
  186. package/Editor/Tags.meta +8 -0
  187. package/Editor/Tools/ImageBlurTool.cs +522 -409
  188. package/Editor/Tools/ImageBlurTool.cs.meta +2 -2
  189. package/Editor/Tools.meta +2 -2
  190. package/Editor/Utils/DxReadOnlyPropertyDrawer.cs +26 -26
  191. package/Editor/Utils/DxReadOnlyPropertyDrawer.cs.meta +11 -11
  192. package/Editor/Utils/EditorUi.cs +228 -0
  193. package/Editor/Utils/EditorUi.cs.meta +11 -0
  194. package/Editor/Utils/EditorUtilities.cs +22 -22
  195. package/Editor/Utils/EditorUtilities.cs.meta +11 -11
  196. package/Editor/Utils/ScriptableObjectSingletonCreator.cs +633 -52
  197. package/Editor/Utils/ScriptableObjectSingletonCreator.cs.meta +2 -2
  198. package/Editor/Utils.meta +8 -8
  199. package/Editor/Visuals/EnhancedImageEditor.cs +160 -160
  200. package/Editor/Visuals/EnhancedImageEditor.cs.meta +11 -11
  201. package/Editor/Visuals.meta +2 -2
  202. package/Editor/WallstopStudios.UnityHelpers.Editor.asmdef +14 -18
  203. package/Editor/WallstopStudios.UnityHelpers.Editor.asmdef.meta +7 -7
  204. package/Editor.meta +8 -8
  205. package/GETTING_STARTED.md +409 -0
  206. package/GETTING_STARTED.md.meta +7 -0
  207. package/GLOSSARY.md +313 -0
  208. package/GLOSSARY.md.meta +7 -0
  209. package/HULLS.md +45 -0
  210. package/HULLS.md.meta +7 -0
  211. package/INDEX.md +429 -0
  212. package/INDEX.md.meta +7 -0
  213. package/LICENSE +21 -21
  214. package/LICENSE.md +7 -7
  215. package/LICENSE.md.meta +7 -7
  216. package/LICENSE.meta +7 -7
  217. package/MATH_AND_EXTENSIONS.md +316 -0
  218. package/MATH_AND_EXTENSIONS.md.meta +7 -0
  219. package/RANDOM_PERFORMANCE.md +140 -0
  220. package/RANDOM_PERFORMANCE.md.meta +7 -0
  221. package/README.md +1183 -188
  222. package/README.md.meta +7 -7
  223. package/REFLECTION_HELPERS.md +272 -0
  224. package/REFLECTION_HELPERS.md.meta +7 -0
  225. package/RELATIONAL_COMPONENTS.md +552 -0
  226. package/RELATIONAL_COMPONENTS.md.meta +7 -0
  227. package/Runtime/AssemblyInfo.cs +9 -0
  228. package/Runtime/AssemblyInfo.cs.meta +11 -0
  229. package/Runtime/Binaries/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  230. package/Runtime/Binaries/Microsoft.Bcl.AsyncInterfaces.dll.meta +33 -33
  231. package/Runtime/Binaries/Microsoft.Bcl.AsyncInterfaces.xml +499 -278
  232. package/Runtime/Binaries/Microsoft.Bcl.AsyncInterfaces.xml.meta +7 -7
  233. package/Runtime/Binaries/System.IO.Pipelines.dll +0 -0
  234. package/Runtime/Binaries/System.IO.Pipelines.dll.meta +33 -0
  235. package/Runtime/Binaries/System.IO.Pipelines.xml +702 -0
  236. package/Runtime/Binaries/System.IO.Pipelines.xml.meta +7 -0
  237. package/Runtime/Binaries/System.Text.Encodings.Web.dll +0 -0
  238. package/Runtime/Binaries/System.Text.Encodings.Web.dll.meta +33 -33
  239. package/Runtime/Binaries/System.Text.Encodings.Web.xml +1084 -1079
  240. package/Runtime/Binaries/System.Text.Encodings.Web.xml.meta +7 -7
  241. package/Runtime/Binaries/System.Text.Json.dll +0 -0
  242. package/Runtime/Binaries/System.Text.Json.dll.meta +33 -33
  243. package/Runtime/Binaries/System.Text.Json.xml +10217 -8116
  244. package/Runtime/Binaries/System.Text.Json.xml.meta +7 -7
  245. package/Runtime/Binaries.meta +8 -8
  246. package/Runtime/Core/Attributes/AnimationEventAttribute.cs +10 -138
  247. package/Runtime/Core/Attributes/AnimationEventAttribute.cs.meta +11 -11
  248. package/Runtime/Core/Attributes/BaseRelationalComponentAttribute.cs +841 -0
  249. package/Runtime/Core/Attributes/BaseRelationalComponentAttribute.cs.meta +11 -0
  250. package/Runtime/Core/Attributes/ChildComponentAttribute.cs +284 -226
  251. package/Runtime/Core/Attributes/ChildComponentAttribute.cs.meta +11 -11
  252. package/Runtime/Core/Attributes/DxReadOnlyAttribute.cs +6 -6
  253. package/Runtime/Core/Attributes/DxReadOnlyAttribute.cs.meta +11 -11
  254. package/Runtime/Core/Attributes/EnumDisplayNameAttribute.cs +15 -15
  255. package/Runtime/Core/Attributes/EnumDisplayNameAttribute.cs.meta +2 -2
  256. package/Runtime/Core/Attributes/IRelationalComponentAssigner.cs +36 -0
  257. package/Runtime/Core/Attributes/IRelationalComponentAssigner.cs.meta +11 -0
  258. package/Runtime/Core/Attributes/IntDropdownAttribute.cs +14 -14
  259. package/Runtime/Core/Attributes/IntDropdownAttribute.cs.meta +2 -2
  260. package/Runtime/Core/Attributes/KSerializableAttribute.cs +19 -19
  261. package/Runtime/Core/Attributes/KSerializableAttribute.cs.meta +11 -11
  262. package/Runtime/Core/Attributes/NotNullAttribute.cs +30 -32
  263. package/Runtime/Core/Attributes/NotNullAttribute.cs.meta +11 -11
  264. package/Runtime/Core/Attributes/ParentComponentAttribute.cs +376 -0
  265. package/Runtime/Core/Attributes/{ParentComponent.cs.meta → ParentComponentAttribute.cs.meta} +11 -11
  266. package/Runtime/Core/Attributes/RelationalComponentAssigner.cs +152 -0
  267. package/Runtime/Core/Attributes/RelationalComponentAssigner.cs.meta +11 -0
  268. package/Runtime/Core/Attributes/RelationalComponentExtensions.cs +61 -14
  269. package/Runtime/Core/Attributes/RelationalComponentExtensions.cs.meta +11 -11
  270. package/Runtime/Core/Attributes/RelationalComponentInitializer.cs +331 -0
  271. package/Runtime/Core/Attributes/RelationalComponentInitializer.cs.meta +11 -0
  272. package/Runtime/Core/Attributes/ScriptableSingletonPathAttribute.cs +15 -15
  273. package/Runtime/Core/Attributes/ScriptableSingletonPathAttribute.cs.meta +2 -2
  274. package/Runtime/Core/Attributes/SiblingComponentAttribute.cs +264 -137
  275. package/Runtime/Core/Attributes/SiblingComponentAttribute.cs.meta +11 -11
  276. package/Runtime/Core/Attributes/ValidateAssignmentAttribute.cs +115 -106
  277. package/Runtime/Core/Attributes/ValidateAssignmentAttribute.cs.meta +11 -11
  278. package/Runtime/Core/Attributes/ValueHelpers.cs +10 -0
  279. package/Runtime/Core/Attributes/ValueHelpers.cs.meta +3 -0
  280. package/Runtime/Core/Attributes/WShowIfAttribute.cs +24 -24
  281. package/Runtime/Core/Attributes/WShowIfAttribute.cs.meta +2 -2
  282. package/Runtime/Core/Attributes.meta +8 -8
  283. package/Runtime/Core/DataStructure/Adapters/FastVector2Int.cs +192 -92
  284. package/Runtime/Core/DataStructure/Adapters/FastVector2Int.cs.meta +11 -11
  285. package/Runtime/Core/DataStructure/Adapters/FastVector3Int.cs +268 -185
  286. package/Runtime/Core/DataStructure/Adapters/FastVector3Int.cs.meta +11 -11
  287. package/Runtime/Core/DataStructure/Adapters/KGuid.cs +360 -305
  288. package/Runtime/Core/DataStructure/Adapters/KGuid.cs.meta +11 -11
  289. package/Runtime/Core/DataStructure/Adapters/KVector2.cs +146 -80
  290. package/Runtime/Core/DataStructure/Adapters/KVector2.cs.meta +11 -11
  291. package/Runtime/Core/DataStructure/Adapters.meta +8 -8
  292. package/Runtime/Core/DataStructure/BitSet.cs +626 -0
  293. package/Runtime/Core/DataStructure/BitSet.cs.meta +11 -0
  294. package/Runtime/Core/DataStructure/BoundingBox3D.cs +405 -0
  295. package/Runtime/Core/DataStructure/BoundingBox3D.cs.meta +11 -0
  296. package/Runtime/Core/DataStructure/Circle.cs +203 -50
  297. package/Runtime/Core/DataStructure/Circle.cs.meta +11 -11
  298. package/Runtime/Core/DataStructure/CyclicBuffer.cs +488 -266
  299. package/Runtime/Core/DataStructure/CyclicBuffer.cs.meta +11 -11
  300. package/Runtime/Core/DataStructure/Deque.cs +561 -0
  301. package/Runtime/Core/DataStructure/Deque.cs.meta +11 -0
  302. package/Runtime/Core/DataStructure/DisjointSet.cs +483 -0
  303. package/Runtime/Core/DataStructure/DisjointSet.cs.meta +11 -0
  304. package/Runtime/Core/DataStructure/Heap.cs +514 -0
  305. package/Runtime/Core/DataStructure/Heap.cs.meta +11 -0
  306. package/Runtime/Core/DataStructure/{ISpatialTree.cs → ISpatialTree2D.cs} +25 -21
  307. package/Runtime/Core/DataStructure/ISpatialTree2D.cs.meta +11 -0
  308. package/Runtime/Core/DataStructure/ISpatialTree3D.cs +33 -0
  309. package/Runtime/Core/DataStructure/ISpatialTree3D.cs.meta +11 -0
  310. package/Runtime/Core/DataStructure/ImmutableBitSet.cs +398 -0
  311. package/Runtime/Core/DataStructure/ImmutableBitSet.cs.meta +3 -0
  312. package/Runtime/Core/DataStructure/KDTree2D.cs +852 -0
  313. package/Runtime/Core/DataStructure/KDTree2D.cs.meta +11 -0
  314. package/Runtime/Core/DataStructure/KDTree3D.cs +911 -0
  315. package/Runtime/Core/DataStructure/KDTree3D.cs.meta +11 -0
  316. package/Runtime/Core/DataStructure/OctTree3D.cs +983 -0
  317. package/Runtime/Core/DataStructure/OctTree3D.cs.meta +11 -0
  318. package/Runtime/Core/DataStructure/PriorityQueue.cs +194 -0
  319. package/Runtime/Core/DataStructure/PriorityQueue.cs.meta +11 -0
  320. package/Runtime/Core/DataStructure/QuadTree2D.cs +722 -0
  321. package/Runtime/Core/DataStructure/QuadTree2D.cs.meta +11 -0
  322. package/Runtime/Core/DataStructure/RTree2D.cs +704 -0
  323. package/Runtime/Core/DataStructure/{RTree.cs.meta → RTree2D.cs.meta} +11 -11
  324. package/Runtime/Core/DataStructure/RTree3D.cs +775 -0
  325. package/Runtime/Core/DataStructure/RTree3D.cs.meta +11 -0
  326. package/Runtime/Core/DataStructure/SparseSet.cs +597 -0
  327. package/Runtime/Core/DataStructure/SparseSet.cs.meta +11 -0
  328. package/Runtime/Core/DataStructure/SpatialHash2D.cs +312 -0
  329. package/Runtime/Core/DataStructure/SpatialHash2D.cs.meta +3 -0
  330. package/Runtime/Core/DataStructure/SpatialHash3D.cs +341 -0
  331. package/Runtime/Core/DataStructure/SpatialHash3D.cs.meta +11 -0
  332. package/Runtime/Core/DataStructure/Sphere.cs +264 -0
  333. package/Runtime/Core/DataStructure/Sphere.cs.meta +11 -0
  334. package/Runtime/Core/DataStructure/StringWrapper.cs +115 -91
  335. package/Runtime/Core/DataStructure/StringWrapper.cs.meta +11 -11
  336. package/Runtime/Core/DataStructure/TimedCache.cs +88 -66
  337. package/Runtime/Core/DataStructure/TimedCache.cs.meta +11 -11
  338. package/Runtime/Core/DataStructure/Trie.cs +660 -359
  339. package/Runtime/Core/DataStructure/Trie.cs.meta +2 -2
  340. package/Runtime/Core/DataStructure.meta +8 -8
  341. package/Runtime/Core/Extension/AnimatorExtensions.cs +40 -25
  342. package/Runtime/Core/Extension/AnimatorExtensions.cs.meta +11 -11
  343. package/Runtime/Core/Extension/AsyncOperationExtensions.cs +404 -110
  344. package/Runtime/Core/Extension/AsyncOperationExtensions.cs.meta +2 -2
  345. package/Runtime/Core/Extension/CircleExtensions.cs +125 -25
  346. package/Runtime/Core/Extension/CircleExtensions.cs.meta +11 -11
  347. package/Runtime/Core/Extension/ColorExtensions.cs +983 -644
  348. package/Runtime/Core/Extension/ColorExtensions.cs.meta +11 -11
  349. package/Runtime/Core/Extension/DictionaryExtensions.cs +606 -299
  350. package/Runtime/Core/Extension/DictionaryExtensions.cs.meta +11 -11
  351. package/Runtime/Core/Extension/DirectionExtensions.cs +377 -213
  352. package/Runtime/Core/Extension/DirectionExtensions.cs.meta +11 -11
  353. package/Runtime/Core/Extension/EnumExtensions.cs +535 -137
  354. package/Runtime/Core/Extension/EnumExtensions.cs.meta +2 -2
  355. package/Runtime/Core/Extension/IEnumerableExtensions.cs +341 -124
  356. package/Runtime/Core/Extension/IEnumerableExtensions.cs.meta +11 -11
  357. package/Runtime/Core/Extension/IListExtensions.cs +767 -248
  358. package/Runtime/Core/Extension/IListExtensions.cs.meta +11 -11
  359. package/Runtime/Core/Extension/IReadonlyListExtensions.cs +687 -37
  360. package/Runtime/Core/Extension/IReadonlyListExtensions.cs.meta +2 -2
  361. package/Runtime/Core/Extension/ProtoEqualityExtensions.cs +292 -0
  362. package/Runtime/Core/Extension/ProtoEqualityExtensions.cs.meta +3 -0
  363. package/Runtime/Core/Extension/RandomExtensions.cs +1006 -109
  364. package/Runtime/Core/Extension/RandomExtensions.cs.meta +11 -11
  365. package/Runtime/Core/Extension/StringExtensions.cs +1635 -239
  366. package/Runtime/Core/Extension/StringExtensions.cs.meta +11 -11
  367. package/Runtime/Core/Extension/UnityExtensions.cs +4555 -1689
  368. package/Runtime/Core/Extension/UnityExtensions.cs.meta +11 -11
  369. package/Runtime/Core/Extension/WallstopStudiosLogger.cs +287 -245
  370. package/Runtime/Core/Extension/WallstopStudiosLogger.cs.meta +11 -11
  371. package/Runtime/Core/Extension.meta +8 -8
  372. package/Runtime/Core/Helper/ArrayConverter.cs +73 -39
  373. package/Runtime/Core/Helper/ArrayConverter.cs.meta +2 -2
  374. package/Runtime/Core/Helper/AssignUtilities.cs +33 -14
  375. package/Runtime/Core/Helper/AssignUtilities.cs.meta +11 -11
  376. package/Runtime/Core/Helper/DirectoryHelper.cs +210 -196
  377. package/Runtime/Core/Helper/DirectoryHelper.cs.meta +2 -2
  378. package/Runtime/Core/Helper/Enumerables.cs +51 -17
  379. package/Runtime/Core/Helper/Enumerables.cs.meta +11 -11
  380. package/Runtime/Core/Helper/FileHelper.cs +97 -77
  381. package/Runtime/Core/Helper/FileHelper.cs.meta +2 -2
  382. package/Runtime/Core/Helper/FormattingHelpers.cs +49 -38
  383. package/Runtime/Core/Helper/FormattingHelpers.cs.meta +2 -2
  384. package/Runtime/Core/Helper/FuncBasedComparer.cs +29 -0
  385. package/Runtime/Core/Helper/FuncBasedComparer.cs.meta +3 -0
  386. package/Runtime/Core/Helper/Geometry.cs +65 -43
  387. package/Runtime/Core/Helper/Geometry.cs.meta +11 -11
  388. package/Runtime/Core/Helper/Helpers.cs +1271 -831
  389. package/Runtime/Core/Helper/Helpers.cs.meta +11 -11
  390. package/Runtime/Core/Helper/IterationHelpers.cs +83 -32
  391. package/Runtime/Core/Helper/IterationHelpers.cs.meta +11 -11
  392. package/Runtime/Core/Helper/LifetimeHelpers.cs +20 -13
  393. package/Runtime/Core/Helper/LifetimeHelpers.cs.meta +11 -11
  394. package/Runtime/Core/Helper/LineHelper.cs +259 -194
  395. package/Runtime/Core/Helper/LineHelper.cs.meta +2 -2
  396. package/Runtime/Core/Helper/Logging/UnityLogTagFormatter.cs +549 -539
  397. package/Runtime/Core/Helper/Logging/UnityLogTagFormatter.cs.meta +2 -2
  398. package/Runtime/Core/Helper/Logging.meta +2 -2
  399. package/Runtime/Core/Helper/Objects.cs +477 -769
  400. package/Runtime/Core/Helper/Objects.cs.meta +11 -11
  401. package/Runtime/Core/Helper/Partials/LogHelpers.cs +13 -13
  402. package/Runtime/Core/Helper/Partials/LogHelpers.cs.meta +2 -2
  403. package/Runtime/Core/Helper/Partials/MathHelpers.cs +45 -30
  404. package/Runtime/Core/Helper/Partials/MathHelpers.cs.meta +2 -2
  405. package/Runtime/Core/Helper/Partials/ObjectHelpers.cs +509 -400
  406. package/Runtime/Core/Helper/Partials/ObjectHelpers.cs.meta +2 -2
  407. package/Runtime/Core/Helper/Partials/TransformHelpers.cs +393 -377
  408. package/Runtime/Core/Helper/Partials/TransformHelpers.cs.meta +2 -2
  409. package/Runtime/Core/Helper/Partials.meta +2 -2
  410. package/Runtime/Core/Helper/PathHelper.cs +42 -15
  411. package/Runtime/Core/Helper/PathHelper.cs.meta +2 -2
  412. package/Runtime/Core/Helper/ReflectionHelpers.cs +5298 -1963
  413. package/Runtime/Core/Helper/ReflectionHelpers.cs.meta +2 -2
  414. package/Runtime/Core/Helper/ReverseComparer.cs +33 -0
  415. package/Runtime/Core/Helper/ReverseComparer.cs.meta +3 -0
  416. package/Runtime/Core/Helper/SceneHelper.cs +251 -224
  417. package/Runtime/Core/Helper/SceneHelper.cs.meta +2 -2
  418. package/Runtime/Core/Helper/SpriteHelpers.cs +52 -41
  419. package/Runtime/Core/Helper/SpriteHelpers.cs.meta +11 -11
  420. package/Runtime/Core/Helper/StringInList.cs +61 -35
  421. package/Runtime/Core/Helper/StringInList.cs.meta +11 -11
  422. package/Runtime/Core/Helper/TestAssemblyHelper.cs +134 -0
  423. package/Runtime/Core/Helper/TestAssemblyHelper.cs.meta +11 -0
  424. package/Runtime/Core/Helper/UnityMainThreadDispatcher.cs +144 -82
  425. package/Runtime/Core/Helper/UnityMainThreadDispatcher.cs.meta +2 -2
  426. package/Runtime/Core/Helper/WallMath.cs +672 -166
  427. package/Runtime/Core/Helper/WallMath.cs.meta +11 -11
  428. package/Runtime/Core/Helper.meta +8 -8
  429. package/Runtime/Core/Math/Line2D.cs +263 -0
  430. package/Runtime/Core/Math/Line2D.cs.meta +11 -0
  431. package/Runtime/Core/Math/Line3D.cs +452 -0
  432. package/Runtime/Core/Math/Line3D.cs.meta +11 -0
  433. package/Runtime/Core/Math/Parabola.cs +241 -47
  434. package/Runtime/Core/Math/Parabola.cs.meta +11 -11
  435. package/Runtime/Core/Math/PointPolygonCheck.cs +175 -36
  436. package/Runtime/Core/Math/PointPolygonCheck.cs.meta +11 -11
  437. package/Runtime/Core/Math/Range.cs +157 -92
  438. package/Runtime/Core/Math/Range.cs.meta +11 -11
  439. package/Runtime/Core/Math.meta +8 -8
  440. package/Runtime/Core/Model/Direction.cs +25 -43
  441. package/Runtime/Core/Model/Direction.cs.meta +11 -11
  442. package/Runtime/Core/Model.meta +8 -8
  443. package/Runtime/Core/OneOf/FastOneOf.cs +252 -152
  444. package/Runtime/Core/OneOf/FastOneOf.cs.meta +11 -11
  445. package/Runtime/Core/OneOf/FastOneOf2.cs +198 -0
  446. package/Runtime/Core/OneOf/FastOneOf2.cs.meta +11 -0
  447. package/Runtime/Core/OneOf/FastOneOf4.cs +324 -0
  448. package/Runtime/Core/OneOf/FastOneOf4.cs.meta +11 -0
  449. package/Runtime/Core/OneOf/None.cs +30 -4
  450. package/Runtime/Core/OneOf/None.cs.meta +11 -11
  451. package/Runtime/Core/OneOf.meta +8 -8
  452. package/Runtime/Core/Random/AbstractRandom.cs +1318 -655
  453. package/Runtime/Core/Random/AbstractRandom.cs.meta +11 -11
  454. package/Runtime/Core/Random/DotNetRandom.cs +118 -54
  455. package/Runtime/Core/Random/DotNetRandom.cs.meta +2 -2
  456. package/Runtime/Core/Random/IRandom.cs +203 -161
  457. package/Runtime/Core/Random/IRandom.cs.meta +11 -11
  458. package/Runtime/Core/Random/IllusionFlow.cs +171 -107
  459. package/Runtime/Core/Random/IllusionFlow.cs.meta +2 -2
  460. package/Runtime/Core/Random/LinearCongruentialGenerator.cs +90 -49
  461. package/Runtime/Core/Random/LinearCongruentialGenerator.cs.meta +2 -2
  462. package/Runtime/Core/Random/NativePcgRandom.cs +139 -97
  463. package/Runtime/Core/Random/NativePcgRandom.cs.meta +11 -11
  464. package/Runtime/Core/Random/PRNG.cs +21 -7
  465. package/Runtime/Core/Random/PRNG.cs.meta +2 -2
  466. package/Runtime/Core/Random/PcgRandom.cs +243 -149
  467. package/Runtime/Core/Random/PcgRandom.cs.meta +11 -11
  468. package/Runtime/Core/Random/PerlinNoise.cs +369 -369
  469. package/Runtime/Core/Random/PerlinNoise.cs.meta +2 -2
  470. package/Runtime/Core/Random/RandomComparer.cs +34 -0
  471. package/Runtime/Core/Random/RandomComparer.cs.meta +3 -0
  472. package/Runtime/Core/Random/RandomState.cs +206 -131
  473. package/Runtime/Core/Random/RandomState.cs.meta +11 -11
  474. package/Runtime/Core/Random/RandomUtilities.cs +55 -26
  475. package/Runtime/Core/Random/RandomUtilities.cs.meta +11 -11
  476. package/Runtime/Core/Random/RomuDuo.cs +171 -116
  477. package/Runtime/Core/Random/RomuDuo.cs.meta +2 -2
  478. package/Runtime/Core/Random/SplitMix64.cs +134 -94
  479. package/Runtime/Core/Random/SplitMix64.cs.meta +2 -2
  480. package/Runtime/Core/Random/SquirrelRandom.cs +127 -84
  481. package/Runtime/Core/Random/SquirrelRandom.cs.meta +11 -11
  482. package/Runtime/Core/Random/SystemRandom.cs +203 -162
  483. package/Runtime/Core/Random/SystemRandom.cs.meta +11 -11
  484. package/Runtime/Core/Random/ThreadLocalRandom.cs +25 -12
  485. package/Runtime/Core/Random/ThreadLocalRandom.cs.meta +11 -11
  486. package/Runtime/Core/Random/UnityRandom.cs +109 -57
  487. package/Runtime/Core/Random/UnityRandom.cs.meta +11 -11
  488. package/Runtime/Core/Random/WyRandom.cs +158 -121
  489. package/Runtime/Core/Random/WyRandom.cs.meta +2 -2
  490. package/Runtime/Core/Random/XorShiftRandom.cs +106 -52
  491. package/Runtime/Core/Random/XorShiftRandom.cs.meta +11 -11
  492. package/Runtime/Core/Random/XoroShiroRandom.cs +184 -119
  493. package/Runtime/Core/Random/XoroShiroRandom.cs.meta +2 -2
  494. package/Runtime/Core/Random.meta +8 -8
  495. package/Runtime/Core/Serialization/JsonConverters/AnimationCurveConverter.cs +248 -0
  496. package/Runtime/Core/Serialization/JsonConverters/AnimationCurveConverter.cs.meta +11 -0
  497. package/Runtime/Core/Serialization/JsonConverters/BitSetConverter.cs +119 -0
  498. package/Runtime/Core/Serialization/JsonConverters/BitSetConverter.cs.meta +11 -0
  499. package/Runtime/Core/Serialization/JsonConverters/BoundingSphereConverter.cs +74 -0
  500. package/Runtime/Core/Serialization/JsonConverters/BoundingSphereConverter.cs.meta +11 -0
  501. package/Runtime/Core/Serialization/JsonConverters/BoundsConverter.cs +132 -0
  502. package/Runtime/Core/Serialization/JsonConverters/BoundsConverter.cs.meta +11 -0
  503. package/Runtime/Core/Serialization/JsonConverters/BoundsIntConverter.cs +135 -0
  504. package/Runtime/Core/Serialization/JsonConverters/BoundsIntConverter.cs.meta +11 -0
  505. package/Runtime/Core/Serialization/JsonConverters/Color32Converter.cs +98 -0
  506. package/Runtime/Core/Serialization/JsonConverters/Color32Converter.cs.meta +11 -0
  507. package/Runtime/Core/Serialization/JsonConverters/ColorBlockConverter.cs +123 -0
  508. package/Runtime/Core/Serialization/JsonConverters/ColorBlockConverter.cs.meta +11 -0
  509. package/Runtime/Core/Serialization/JsonConverters/ColorConverter.cs +88 -88
  510. package/Runtime/Core/Serialization/JsonConverters/ColorConverter.cs.meta +2 -2
  511. package/Runtime/Core/Serialization/JsonConverters/CyclicBufferConverterFactory.cs +112 -0
  512. package/Runtime/Core/Serialization/JsonConverters/CyclicBufferConverterFactory.cs.meta +11 -0
  513. package/Runtime/Core/Serialization/JsonConverters/DequeConverterFactory.cs +62 -0
  514. package/Runtime/Core/Serialization/JsonConverters/DequeConverterFactory.cs.meta +11 -0
  515. package/Runtime/Core/Serialization/JsonConverters/FastVector2IntConverter.cs +72 -0
  516. package/Runtime/Core/Serialization/JsonConverters/FastVector2IntConverter.cs.meta +11 -0
  517. package/Runtime/Core/Serialization/JsonConverters/FastVector3IntConverter.cs +80 -0
  518. package/Runtime/Core/Serialization/JsonConverters/FastVector3IntConverter.cs.meta +11 -0
  519. package/Runtime/Core/Serialization/JsonConverters/GameObjectConverter.cs +44 -36
  520. package/Runtime/Core/Serialization/JsonConverters/GameObjectConverter.cs.meta +2 -2
  521. package/Runtime/Core/Serialization/JsonConverters/GradientConverter.cs +245 -0
  522. package/Runtime/Core/Serialization/JsonConverters/GradientConverter.cs.meta +11 -0
  523. package/Runtime/Core/Serialization/JsonConverters/Hash128Converter.cs +92 -0
  524. package/Runtime/Core/Serialization/JsonConverters/Hash128Converter.cs.meta +11 -0
  525. package/Runtime/Core/Serialization/JsonConverters/ImmutableBitSetConverter.cs +119 -0
  526. package/Runtime/Core/Serialization/JsonConverters/ImmutableBitSetConverter.cs.meta +11 -0
  527. package/Runtime/Core/Serialization/JsonConverters/KVector2Converter.cs +72 -0
  528. package/Runtime/Core/Serialization/JsonConverters/KVector2Converter.cs.meta +11 -0
  529. package/Runtime/Core/Serialization/JsonConverters/LayerMaskConverter.cs +95 -0
  530. package/Runtime/Core/Serialization/JsonConverters/LayerMaskConverter.cs.meta +11 -0
  531. package/Runtime/Core/Serialization/JsonConverters/Matrix4x4Converter.cs +237 -218
  532. package/Runtime/Core/Serialization/JsonConverters/Matrix4x4Converter.cs.meta +2 -2
  533. package/Runtime/Core/Serialization/JsonConverters/MinMaxCurveConverter.cs +142 -0
  534. package/Runtime/Core/Serialization/JsonConverters/MinMaxCurveConverter.cs.meta +11 -0
  535. package/Runtime/Core/Serialization/JsonConverters/MinMaxGradientConverter.cs +135 -0
  536. package/Runtime/Core/Serialization/JsonConverters/MinMaxGradientConverter.cs.meta +11 -0
  537. package/Runtime/Core/Serialization/JsonConverters/PlaneConverter.cs +79 -0
  538. package/Runtime/Core/Serialization/JsonConverters/PlaneConverter.cs.meta +11 -0
  539. package/Runtime/Core/Serialization/JsonConverters/PoseConverter.cs +76 -0
  540. package/Runtime/Core/Serialization/JsonConverters/PoseConverter.cs.meta +11 -0
  541. package/Runtime/Core/Serialization/JsonConverters/QuaternionConverter.cs +88 -0
  542. package/Runtime/Core/Serialization/JsonConverters/QuaternionConverter.cs.meta +11 -0
  543. package/Runtime/Core/Serialization/JsonConverters/RangeConverterFactory.cs +106 -0
  544. package/Runtime/Core/Serialization/JsonConverters/RangeConverterFactory.cs.meta +11 -0
  545. package/Runtime/Core/Serialization/JsonConverters/RangeIntConverter.cs +71 -0
  546. package/Runtime/Core/Serialization/JsonConverters/RangeIntConverter.cs.meta +11 -0
  547. package/Runtime/Core/Serialization/JsonConverters/Ray2DConverter.cs +80 -0
  548. package/Runtime/Core/Serialization/JsonConverters/Ray2DConverter.cs.meta +11 -0
  549. package/Runtime/Core/Serialization/JsonConverters/RayConverter.cs +76 -0
  550. package/Runtime/Core/Serialization/JsonConverters/RayConverter.cs.meta +11 -0
  551. package/Runtime/Core/Serialization/JsonConverters/RaycastHitConverter.cs +115 -0
  552. package/Runtime/Core/Serialization/JsonConverters/RaycastHitConverter.cs.meta +11 -0
  553. package/Runtime/Core/Serialization/JsonConverters/RectConverter.cs +84 -0
  554. package/Runtime/Core/Serialization/JsonConverters/RectConverter.cs.meta +11 -0
  555. package/Runtime/Core/Serialization/JsonConverters/RectIntConverter.cs +88 -0
  556. package/Runtime/Core/Serialization/JsonConverters/RectIntConverter.cs.meta +11 -0
  557. package/Runtime/Core/Serialization/JsonConverters/RectOffsetConverter.cs +87 -0
  558. package/Runtime/Core/Serialization/JsonConverters/RectOffsetConverter.cs.meta +11 -0
  559. package/Runtime/Core/Serialization/JsonConverters/RenderTextureDescriptorConverter.cs +264 -0
  560. package/Runtime/Core/Serialization/JsonConverters/RenderTextureDescriptorConverter.cs.meta +11 -0
  561. package/Runtime/Core/Serialization/JsonConverters/ResolutionConverter.cs +158 -0
  562. package/Runtime/Core/Serialization/JsonConverters/ResolutionConverter.cs.meta +11 -0
  563. package/Runtime/Core/Serialization/JsonConverters/SceneConverter.cs +103 -0
  564. package/Runtime/Core/Serialization/JsonConverters/SceneConverter.cs.meta +11 -0
  565. package/Runtime/Core/Serialization/JsonConverters/SphericalHarmonicsL2Converter.cs +121 -0
  566. package/Runtime/Core/Serialization/JsonConverters/SphericalHarmonicsL2Converter.cs.meta +11 -0
  567. package/Runtime/Core/Serialization/JsonConverters/TouchConverter.cs +54 -0
  568. package/Runtime/Core/Serialization/JsonConverters/TouchConverter.cs.meta +11 -0
  569. package/Runtime/Core/Serialization/JsonConverters/TypeConverter.cs +30 -28
  570. package/Runtime/Core/Serialization/JsonConverters/TypeConverter.cs.meta +2 -2
  571. package/Runtime/Core/Serialization/JsonConverters/Vector2Converter.cs +72 -74
  572. package/Runtime/Core/Serialization/JsonConverters/Vector2Converter.cs.meta +11 -11
  573. package/Runtime/Core/Serialization/JsonConverters/Vector2IntConverter.cs +72 -0
  574. package/Runtime/Core/Serialization/JsonConverters/Vector2IntConverter.cs.meta +11 -0
  575. package/Runtime/Core/Serialization/JsonConverters/Vector3Converter.cs +80 -81
  576. package/Runtime/Core/Serialization/JsonConverters/Vector3Converter.cs.meta +11 -11
  577. package/Runtime/Core/Serialization/JsonConverters/Vector3IntConverter.cs +80 -0
  578. package/Runtime/Core/Serialization/JsonConverters/Vector3IntConverter.cs.meta +11 -0
  579. package/Runtime/Core/Serialization/JsonConverters/Vector4Converter.cs +88 -88
  580. package/Runtime/Core/Serialization/JsonConverters/Vector4Converter.cs.meta +2 -2
  581. package/Runtime/Core/Serialization/JsonConverters.meta +8 -8
  582. package/Runtime/Core/Serialization/ProtobufUnitySurrogates.cs +383 -0
  583. package/Runtime/Core/Serialization/ProtobufUnitySurrogates.cs.meta +11 -0
  584. package/Runtime/Core/Serialization/Serializer.cs +2121 -195
  585. package/Runtime/Core/Serialization/Serializer.cs.meta +11 -11
  586. package/Runtime/Core/Serialization.meta +8 -8
  587. package/Runtime/Core/Threading/SingleThreadedThreadPool.cs +228 -228
  588. package/Runtime/Core/Threading/SingleThreadedThreadPool.cs.meta +11 -11
  589. package/Runtime/Core/Threading.meta +8 -8
  590. package/Runtime/Core.meta +8 -8
  591. package/Runtime/Integrations/VContainer/AssemblyInfo.cs +9 -0
  592. package/Runtime/Integrations/VContainer/AssemblyInfo.cs.meta +3 -0
  593. package/Runtime/Integrations/VContainer/ObjectResolverRelationalExtensions.cs +281 -0
  594. package/Runtime/Integrations/VContainer/ObjectResolverRelationalExtensions.cs.meta +11 -0
  595. package/Runtime/Integrations/VContainer/RelationalComponentEntryPoint.cs +189 -0
  596. package/Runtime/Integrations/VContainer/RelationalComponentEntryPoint.cs.meta +11 -0
  597. package/Runtime/Integrations/VContainer/RelationalComponentsBuilderExtensions.cs +90 -0
  598. package/Runtime/Integrations/VContainer/RelationalComponentsBuilderExtensions.cs.meta +11 -0
  599. package/Runtime/Integrations/VContainer/RelationalObjectPools.cs +114 -0
  600. package/Runtime/Integrations/VContainer/RelationalObjectPools.cs.meta +11 -0
  601. package/Runtime/Integrations/VContainer/RelationalSceneAssignmentOptions.cs +95 -0
  602. package/Runtime/Integrations/VContainer/RelationalSceneAssignmentOptions.cs.meta +11 -0
  603. package/Runtime/Integrations/VContainer/RelationalSceneLoadListener.cs +241 -0
  604. package/Runtime/Integrations/VContainer/RelationalSceneLoadListener.cs.meta +11 -0
  605. package/Runtime/Integrations/VContainer/WallstopStudios.UnityHelpers.Integration.VContainer.asmdef +30 -0
  606. package/Runtime/Integrations/VContainer/WallstopStudios.UnityHelpers.Integration.VContainer.asmdef.meta +7 -0
  607. package/Runtime/Integrations/VContainer.meta +8 -0
  608. package/Runtime/Integrations/Zenject/AssemblyInfo.cs +9 -0
  609. package/Runtime/Integrations/Zenject/AssemblyInfo.cs.meta +3 -0
  610. package/Runtime/Integrations/Zenject/DiContainerRelationalExtensions.cs +247 -0
  611. package/Runtime/Integrations/Zenject/DiContainerRelationalExtensions.cs.meta +11 -0
  612. package/Runtime/Integrations/Zenject/RelationalComponentSceneInitializer.cs +182 -0
  613. package/Runtime/Integrations/Zenject/RelationalComponentSceneInitializer.cs.meta +11 -0
  614. package/Runtime/Integrations/Zenject/RelationalComponentsInstaller.cs +94 -0
  615. package/Runtime/Integrations/Zenject/RelationalComponentsInstaller.cs.meta +11 -0
  616. package/Runtime/Integrations/Zenject/RelationalMemoryPools.cs +44 -0
  617. package/Runtime/Integrations/Zenject/RelationalMemoryPools.cs.meta +11 -0
  618. package/Runtime/Integrations/Zenject/RelationalSceneAssignmentOptions.cs +93 -0
  619. package/Runtime/Integrations/Zenject/RelationalSceneAssignmentOptions.cs.meta +11 -0
  620. package/Runtime/Integrations/Zenject/RelationalSceneLoadListener.cs +243 -0
  621. package/Runtime/Integrations/Zenject/RelationalSceneLoadListener.cs.meta +11 -0
  622. package/Runtime/Integrations/Zenject/WallstopStudios.UnityHelpers.Integration.Zenject.asmdef +30 -0
  623. package/Runtime/Integrations/Zenject/WallstopStudios.UnityHelpers.Integration.Zenject.asmdef.meta +7 -0
  624. package/Runtime/Integrations/Zenject.meta +8 -0
  625. package/Runtime/Integrations.meta +8 -0
  626. package/Runtime/Protobuf-Net/System.Collections.Immutable.dll.meta +33 -33
  627. package/Runtime/Protobuf-Net/System.Runtime.CompilerServices.Unsafe.dll.meta +33 -33
  628. package/Runtime/Protobuf-Net/protobuf-net.Core.dll.meta +33 -33
  629. package/Runtime/Protobuf-Net/protobuf-net.dll.meta +33 -33
  630. package/Runtime/Protobuf-Net.meta +8 -8
  631. package/Runtime/Tags/AlwaysIncludeInAttributeMetadataCacheAttribute.cs +11 -0
  632. package/Runtime/Tags/AlwaysIncludeInAttributeMetadataCacheAttribute.cs.meta +11 -0
  633. package/Runtime/Tags/Attribute.cs +399 -205
  634. package/Runtime/Tags/Attribute.cs.meta +2 -2
  635. package/Runtime/Tags/AttributeEffect.cs +372 -281
  636. package/Runtime/Tags/AttributeEffect.cs.meta +2 -2
  637. package/Runtime/Tags/AttributeMetadataCache.cs +500 -0
  638. package/Runtime/Tags/AttributeMetadataCache.cs.meta +11 -0
  639. package/Runtime/Tags/AttributeMetadataFilters.cs +108 -0
  640. package/Runtime/Tags/AttributeMetadataFilters.cs.meta +11 -0
  641. package/Runtime/Tags/AttributeModification.cs +132 -48
  642. package/Runtime/Tags/AttributeModification.cs.meta +2 -2
  643. package/Runtime/Tags/AttributeUtilities.cs +376 -209
  644. package/Runtime/Tags/AttributeUtilities.cs.meta +2 -2
  645. package/Runtime/Tags/AttributesComponent.cs +237 -163
  646. package/Runtime/Tags/AttributesComponent.cs.meta +2 -2
  647. package/Runtime/Tags/CollisionSenses.cs +117 -91
  648. package/Runtime/Tags/CollisionSenses.cs.meta +2 -2
  649. package/Runtime/Tags/CosmeticEffectComponent.cs +112 -50
  650. package/Runtime/Tags/CosmeticEffectComponent.cs.meta +2 -2
  651. package/Runtime/Tags/CosmeticEffectData.cs +109 -63
  652. package/Runtime/Tags/CosmeticEffectData.cs.meta +2 -2
  653. package/Runtime/Tags/EffectHandle.cs +150 -65
  654. package/Runtime/Tags/EffectHandle.cs.meta +2 -2
  655. package/Runtime/Tags/EffectHandler.cs +470 -393
  656. package/Runtime/Tags/EffectHandler.cs.meta +2 -2
  657. package/Runtime/Tags/ModificationAction.cs +60 -9
  658. package/Runtime/Tags/ModificationAction.cs.meta +2 -2
  659. package/Runtime/Tags/ModifierDurationType.cs +71 -13
  660. package/Runtime/Tags/ModifierDurationType.cs.meta +2 -2
  661. package/Runtime/Tags/TagHandler.cs +373 -158
  662. package/Runtime/Tags/TagHandler.cs.meta +2 -2
  663. package/Runtime/Tags.meta +2 -2
  664. package/Runtime/Utils/AnimationEventEqualityComparer.cs +198 -161
  665. package/Runtime/Utils/AnimationEventEqualityComparer.cs.meta +11 -11
  666. package/Runtime/Utils/AnimatorEnumStateMachine.cs +110 -88
  667. package/Runtime/Utils/AnimatorEnumStateMachine.cs.meta +11 -11
  668. package/Runtime/Utils/Ascii85.cs +132 -115
  669. package/Runtime/Utils/Ascii85.cs.meta +2 -2
  670. package/Runtime/Utils/Buffers.cs +1151 -550
  671. package/Runtime/Utils/Buffers.cs.meta +11 -11
  672. package/Runtime/Utils/CenterPointOffset.cs +35 -30
  673. package/Runtime/Utils/CenterPointOffset.cs.meta +2 -2
  674. package/Runtime/Utils/ChildSpawner.cs +250 -157
  675. package/Runtime/Utils/ChildSpawner.cs.meta +2 -2
  676. package/Runtime/Utils/CircleLineRenderer.cs +142 -142
  677. package/Runtime/Utils/CircleLineRenderer.cs.meta +11 -11
  678. package/Runtime/Utils/CollisionProxy.cs +48 -48
  679. package/Runtime/Utils/CollisionProxy.cs.meta +2 -2
  680. package/Runtime/Utils/CoroutineHandler.cs +4 -4
  681. package/Runtime/Utils/CoroutineHandler.cs.meta +2 -2
  682. package/Runtime/Utils/DeferredDisposalResult.cs +20 -23
  683. package/Runtime/Utils/DeferredDisposalResult.cs.meta +2 -2
  684. package/Runtime/Utils/LZMA.cs +276 -53
  685. package/Runtime/Utils/LZMA.cs.meta +2 -2
  686. package/Runtime/Utils/MatchColliderToSprite.cs +104 -104
  687. package/Runtime/Utils/MatchColliderToSprite.cs.meta +2 -2
  688. package/Runtime/Utils/MatchTransform.cs +99 -82
  689. package/Runtime/Utils/MatchTransform.cs.meta +2 -2
  690. package/Runtime/Utils/Oscillator.cs +27 -27
  691. package/Runtime/Utils/Oscillator.cs.meta +11 -11
  692. package/Runtime/Utils/PolygonCollider2DOptimizer.cs +104 -83
  693. package/Runtime/Utils/PolygonCollider2DOptimizer.cs.meta +2 -2
  694. package/Runtime/Utils/RuntimeSingleton.cs +139 -89
  695. package/Runtime/Utils/RuntimeSingleton.cs.meta +11 -11
  696. package/Runtime/Utils/ScriptableObjectSingleton.cs +225 -85
  697. package/Runtime/Utils/ScriptableObjectSingleton.cs.meta +2 -2
  698. package/Runtime/Utils/SerializedStringComparer.cs +107 -107
  699. package/Runtime/Utils/SerializedStringComparer.cs.meta +2 -2
  700. package/Runtime/Utils/SetTextureImportData.cs +71 -69
  701. package/Runtime/Utils/SetTextureImportData.cs.meta +11 -11
  702. package/Runtime/Utils/SevenZip/Common/CRC.cs +70 -70
  703. package/Runtime/Utils/SevenZip/Common/CRC.cs.meta +11 -11
  704. package/Runtime/Utils/SevenZip/Common/InBuffer.cs +84 -84
  705. package/Runtime/Utils/SevenZip/Common/InBuffer.cs.meta +11 -11
  706. package/Runtime/Utils/SevenZip/Common/OutBuffer.cs +70 -70
  707. package/Runtime/Utils/SevenZip/Common/OutBuffer.cs.meta +11 -11
  708. package/Runtime/Utils/SevenZip/Common.meta +2 -2
  709. package/Runtime/Utils/SevenZip/Compress/LZ/IMatchFinder.cs +28 -28
  710. package/Runtime/Utils/SevenZip/Compress/LZ/IMatchFinder.cs.meta +11 -11
  711. package/Runtime/Utils/SevenZip/Compress/LZ/LzBinTree.cs +454 -454
  712. package/Runtime/Utils/SevenZip/Compress/LZ/LzBinTree.cs.meta +11 -11
  713. package/Runtime/Utils/SevenZip/Compress/LZ/LzInWindow.cs +179 -179
  714. package/Runtime/Utils/SevenZip/Compress/LZ/LzInWindow.cs.meta +11 -11
  715. package/Runtime/Utils/SevenZip/Compress/LZ/LzOutWindow.cs +137 -137
  716. package/Runtime/Utils/SevenZip/Compress/LZ/LzOutWindow.cs.meta +11 -11
  717. package/Runtime/Utils/SevenZip/Compress/LZ.meta +8 -8
  718. package/Runtime/Utils/SevenZip/Compress/LZMA/LzmaBase.cs +110 -110
  719. package/Runtime/Utils/SevenZip/Compress/LZMA/LzmaBase.cs.meta +11 -11
  720. package/Runtime/Utils/SevenZip/Compress/LZMA/LzmaDecoder.cs +525 -527
  721. package/Runtime/Utils/SevenZip/Compress/LZMA/LzmaDecoder.cs.meta +11 -11
  722. package/Runtime/Utils/SevenZip/Compress/LZMA/LzmaEncoder.cs +1891 -1904
  723. package/Runtime/Utils/SevenZip/Compress/LZMA/LzmaEncoder.cs.meta +11 -11
  724. package/Runtime/Utils/SevenZip/Compress/LZMA.meta +8 -8
  725. package/Runtime/Utils/SevenZip/Compress/RangeCoder/RangeCoder.cs +242 -242
  726. package/Runtime/Utils/SevenZip/Compress/RangeCoder/RangeCoder.cs.meta +11 -11
  727. package/Runtime/Utils/SevenZip/Compress/RangeCoder/RangeCoderBit.cs +146 -149
  728. package/Runtime/Utils/SevenZip/Compress/RangeCoder/RangeCoderBit.cs.meta +11 -11
  729. package/Runtime/Utils/SevenZip/Compress/RangeCoder/RangeCoderBitTree.cs +177 -177
  730. package/Runtime/Utils/SevenZip/Compress/RangeCoder/RangeCoderBitTree.cs.meta +11 -11
  731. package/Runtime/Utils/SevenZip/Compress/RangeCoder.meta +8 -8
  732. package/Runtime/Utils/SevenZip/Compress.meta +8 -8
  733. package/Runtime/Utils/SevenZip/ICoder.cs +177 -177
  734. package/Runtime/Utils/SevenZip/ICoder.cs.meta +11 -11
  735. package/Runtime/Utils/SevenZip.meta +2 -2
  736. package/Runtime/Utils/SpriteRendererMetadata.cs +346 -370
  737. package/Runtime/Utils/SpriteRendererMetadata.cs.meta +2 -2
  738. package/Runtime/Utils/SpriteRendererSyncer.cs +100 -100
  739. package/Runtime/Utils/SpriteRendererSyncer.cs.meta +2 -2
  740. package/Runtime/Utils/StartTracker.cs +15 -15
  741. package/Runtime/Utils/StartTracker.cs.meta +2 -2
  742. package/Runtime/Utils/TextureScale.cs +364 -179
  743. package/Runtime/Utils/TextureScale.cs.meta +2 -2
  744. package/Runtime/Utils/TypeNameSorter.cs +17 -17
  745. package/Runtime/Utils/TypeNameSorter.cs.meta +2 -2
  746. package/Runtime/Utils/UnityObjectNameComparer.cs +89 -89
  747. package/Runtime/Utils/UnityObjectNameComparer.cs.meta +2 -2
  748. package/Runtime/Utils.meta +8 -8
  749. package/Runtime/Visuals/AnimatedSpriteLayer.cs +217 -130
  750. package/Runtime/Visuals/AnimatedSpriteLayer.cs.meta +2 -2
  751. package/Runtime/Visuals/UGUI/EnhancedImage.cs +224 -85
  752. package/Runtime/Visuals/UGUI/EnhancedImage.cs.meta +2 -2
  753. package/Runtime/Visuals/UGUI.meta +2 -2
  754. package/Runtime/Visuals/UIToolkit/LayeredImage.cs +784 -484
  755. package/Runtime/Visuals/UIToolkit/LayeredImage.cs.meta +2 -2
  756. package/Runtime/Visuals/UIToolkit/MultiFileSelectorElement.cs +945 -322
  757. package/Runtime/Visuals/UIToolkit/MultiFileSelectorElement.cs.meta +2 -2
  758. package/Runtime/Visuals/UIToolkit.meta +2 -2
  759. package/Runtime/Visuals.meta +2 -2
  760. package/Runtime/WallstopStudios.UnityHelpers.asmdef +22 -14
  761. package/Runtime/WallstopStudios.UnityHelpers.asmdef.meta +7 -7
  762. package/Runtime.meta +8 -8
  763. package/SERIALIZATION.md +663 -0
  764. package/SERIALIZATION.md.meta +7 -0
  765. package/SINGLETONS.md +427 -0
  766. package/SINGLETONS.md.meta +7 -0
  767. package/SPATIAL_TREES_2D_GUIDE.md +261 -0
  768. package/SPATIAL_TREES_2D_GUIDE.md.meta +7 -0
  769. package/SPATIAL_TREES_3D_GUIDE.md +214 -0
  770. package/SPATIAL_TREES_3D_GUIDE.md.meta +7 -0
  771. package/SPATIAL_TREE_2D_PERFORMANCE.md +241 -0
  772. package/SPATIAL_TREE_2D_PERFORMANCE.md.meta +7 -0
  773. package/SPATIAL_TREE_3D_PERFORMANCE.md +243 -0
  774. package/SPATIAL_TREE_3D_PERFORMANCE.md.meta +7 -0
  775. package/SPATIAL_TREE_SEMANTICS.md +106 -0
  776. package/SPATIAL_TREE_SEMANTICS.md.meta +7 -0
  777. package/Samples~/DI - VContainer/Prefabs/RelationalConsumer.prefab +77 -0
  778. package/Samples~/DI - VContainer/Prefabs/RelationalConsumer.prefab.meta +8 -0
  779. package/Samples~/DI - VContainer/Prefabs/Spawner.prefab +47 -0
  780. package/Samples~/DI - VContainer/Prefabs/Spawner.prefab.meta +8 -0
  781. package/Samples~/DI - VContainer/Prefabs.meta +9 -0
  782. package/Samples~/DI - VContainer/README.md +515 -0
  783. package/Samples~/DI - VContainer/README.md.meta +8 -0
  784. package/Samples~/DI - VContainer/Scenes/VContainer_Sample.unity +120 -0
  785. package/Samples~/DI - VContainer/Scenes/VContainer_Sample.unity.meta +8 -0
  786. package/Samples~/DI - VContainer/Scenes.meta +9 -0
  787. package/Samples~/DI - VContainer/Scripts/GameLifetimeScope.cs +42 -0
  788. package/Samples~/DI - VContainer/Scripts/GameLifetimeScope.cs.meta +12 -0
  789. package/Samples~/DI - VContainer/Scripts/RelationalConsumer.cs +24 -0
  790. package/Samples~/DI - VContainer/Scripts/RelationalConsumer.cs.meta +12 -0
  791. package/Samples~/DI - VContainer/Scripts/Samples.UnityHelpers.DI.VContainer.asmdef +37 -0
  792. package/Samples~/DI - VContainer/Scripts/Samples.UnityHelpers.DI.VContainer.asmdef.meta +8 -0
  793. package/Samples~/DI - VContainer/Scripts/Spawner.cs +130 -0
  794. package/Samples~/DI - VContainer/Scripts/Spawner.cs.meta +12 -0
  795. package/Samples~/DI - VContainer/Scripts.meta +9 -0
  796. package/Samples~/DI - VContainer.meta +9 -0
  797. package/Samples~/DI - Zenject/Prefabs/RelationalConsumer.prefab +77 -0
  798. package/Samples~/DI - Zenject/Prefabs/RelationalConsumer.prefab.meta +8 -0
  799. package/Samples~/DI - Zenject/Prefabs/SpawnerZenject.prefab +47 -0
  800. package/Samples~/DI - Zenject/Prefabs/SpawnerZenject.prefab.meta +8 -0
  801. package/Samples~/DI - Zenject/Prefabs.meta +9 -0
  802. package/Samples~/DI - Zenject/README.md +553 -0
  803. package/Samples~/DI - Zenject/README.md.meta +7 -0
  804. package/Samples~/DI - Zenject/Scenes/Zenject_Sample.unity +164 -0
  805. package/Samples~/DI - Zenject/Scenes/Zenject_Sample.unity.meta +8 -0
  806. package/Samples~/DI - Zenject/Scenes.meta +9 -0
  807. package/Samples~/DI - Zenject/Scripts/RelationalConsumer.cs +22 -0
  808. package/Samples~/DI - Zenject/Scripts/RelationalConsumer.cs.meta +12 -0
  809. package/Samples~/DI - Zenject/Scripts/RelationalConsumerPool.cs +37 -0
  810. package/Samples~/DI - Zenject/Scripts/RelationalConsumerPool.cs.meta +12 -0
  811. package/Samples~/DI - Zenject/Scripts/Samples.UnityHelpers.DI.Zenject.asmdef +36 -0
  812. package/Samples~/DI - Zenject/Scripts/Samples.UnityHelpers.DI.Zenject.asmdef.meta +8 -0
  813. package/Samples~/DI - Zenject/Scripts/SceneContextPlaceholder.cs +47 -0
  814. package/Samples~/DI - Zenject/Scripts/SceneContextPlaceholder.cs.meta +12 -0
  815. package/Samples~/DI - Zenject/Scripts/SpawnerZenject.cs +91 -0
  816. package/Samples~/DI - Zenject/Scripts/SpawnerZenject.cs.meta +12 -0
  817. package/Samples~/DI - Zenject/Scripts.meta +9 -0
  818. package/Samples~/DI - Zenject.meta +9 -0
  819. package/Samples~/Random - PRNG/README.md +13 -0
  820. package/Samples~/Random - PRNG/README.md.meta +8 -0
  821. package/Samples~/Random - PRNG/Scripts/RandomPrngDemo.cs +28 -0
  822. package/Samples~/Random - PRNG/Scripts/RandomPrngDemo.cs.meta +12 -0
  823. package/Samples~/Random - PRNG/Scripts/Samples.UnityHelpers.Random.Prng.asmdef +17 -0
  824. package/Samples~/Random - PRNG/Scripts/Samples.UnityHelpers.Random.Prng.asmdef.meta +8 -0
  825. package/Samples~/Random - PRNG/Scripts.meta +9 -0
  826. package/Samples~/Random - PRNG.meta +9 -0
  827. package/Samples~/Relational Components - Basic/README.md +21 -0
  828. package/Samples~/Relational Components - Basic/README.md.meta +8 -0
  829. package/Samples~/Relational Components - Basic/Scripts/RelationalBasicConsumer.cs +37 -0
  830. package/Samples~/Relational Components - Basic/Scripts/RelationalBasicConsumer.cs.meta +12 -0
  831. package/Samples~/Relational Components - Basic/Scripts/Samples.UnityHelpers.Relational.Basic.asmdef +17 -0
  832. package/Samples~/Relational Components - Basic/Scripts/Samples.UnityHelpers.Relational.Basic.asmdef.meta +8 -0
  833. package/Samples~/Relational Components - Basic/Scripts.meta +9 -0
  834. package/Samples~/Relational Components - Basic.meta +9 -0
  835. package/Samples~/Serialization - JSON/README.md +14 -0
  836. package/Samples~/Serialization - JSON/README.md.meta +8 -0
  837. package/Samples~/Serialization - JSON/Scripts/JsonSerializationDemo.cs +50 -0
  838. package/Samples~/Serialization - JSON/Scripts/JsonSerializationDemo.cs.meta +12 -0
  839. package/Samples~/Serialization - JSON/Scripts/Samples.UnityHelpers.Serialization.Json.asmdef +17 -0
  840. package/Samples~/Serialization - JSON/Scripts/Samples.UnityHelpers.Serialization.Json.asmdef.meta +8 -0
  841. package/Samples~/Serialization - JSON/Scripts.meta +9 -0
  842. package/Samples~/Serialization - JSON.meta +9 -0
  843. package/Samples~/Spatial Structures - 2D and 3D/README.md +14 -0
  844. package/Samples~/Spatial Structures - 2D and 3D/README.md.meta +8 -0
  845. package/Samples~/Spatial Structures - 2D and 3D/Scripts/Samples.UnityHelpers.SpatialStructures.asmdef +17 -0
  846. package/Samples~/Spatial Structures - 2D and 3D/Scripts/Samples.UnityHelpers.SpatialStructures.asmdef.meta +8 -0
  847. package/Samples~/Spatial Structures - 2D and 3D/Scripts/SpatialStructuresDemo.cs +62 -0
  848. package/Samples~/Spatial Structures - 2D and 3D/Scripts/SpatialStructuresDemo.cs.meta +12 -0
  849. package/Samples~/Spatial Structures - 2D and 3D/Scripts.meta +9 -0
  850. package/Samples~/Spatial Structures - 2D and 3D.meta +9 -0
  851. package/Samples~/UGUI - EnhancedImage/README.md +13 -0
  852. package/Samples~/UGUI - EnhancedImage/README.md.meta +8 -0
  853. package/Samples~/UGUI - EnhancedImage/Scripts/EnhancedImageDemo.cs +36 -0
  854. package/Samples~/UGUI - EnhancedImage/Scripts/EnhancedImageDemo.cs.meta +12 -0
  855. package/Samples~/UGUI - EnhancedImage/Scripts/Samples.UnityHelpers.UGUI.EnhancedImage.asmdef +17 -0
  856. package/Samples~/UGUI - EnhancedImage/Scripts/Samples.UnityHelpers.UGUI.EnhancedImage.asmdef.meta +8 -0
  857. package/Samples~/UGUI - EnhancedImage/Scripts.meta +9 -0
  858. package/Samples~/UGUI - EnhancedImage.meta +9 -0
  859. package/Samples~/UI Toolkit - MultiFile Selector (Editor)/README.md +13 -0
  860. package/Samples~/UI Toolkit - MultiFile Selector (Editor)/README.md.meta +8 -0
  861. package/Samples~/UI Toolkit - MultiFile Selector (Editor)/Scripts/Editor/MultiFileSelectorSampleWindow.cs +45 -0
  862. package/Samples~/UI Toolkit - MultiFile Selector (Editor)/Scripts/Editor/MultiFileSelectorSampleWindow.cs.meta +12 -0
  863. package/Samples~/UI Toolkit - MultiFile Selector (Editor)/Scripts/Editor/Samples.UnityHelpers.UIToolkit.Editor.asmdef +19 -0
  864. package/Samples~/UI Toolkit - MultiFile Selector (Editor)/Scripts/Editor/Samples.UnityHelpers.UIToolkit.Editor.asmdef.meta +8 -0
  865. package/Samples~/UI Toolkit - MultiFile Selector (Editor)/Scripts/Editor.meta +9 -0
  866. package/Samples~/UI Toolkit - MultiFile Selector (Editor)/Scripts.meta +9 -0
  867. package/Samples~/UI Toolkit - MultiFile Selector (Editor).meta +9 -0
  868. package/Shaders/Materials/BackgroundMask-Material.mat +59 -59
  869. package/Shaders/Materials/BackgroundMask-Material.mat.meta +8 -8
  870. package/Shaders/Materials.meta +8 -8
  871. package/Shaders/ShaderGraph/BackgroundMask.shadergraph +1653 -1653
  872. package/Shaders/ShaderGraph/BackgroundMask.shadergraph.meta +10 -10
  873. package/Shaders/ShaderGraph/DebugDisplayValue.shadersubgraph +835 -835
  874. package/Shaders/ShaderGraph/DebugDisplayValue.shadersubgraph.meta +10 -10
  875. package/Shaders/ShaderGraph.meta +8 -8
  876. package/Shaders/Support/EnhancedImageSupport.shader +64 -0
  877. package/Shaders/Support/EnhancedImageSupport.shader.meta +9 -0
  878. package/Shaders/Support.meta +8 -0
  879. package/Shaders.meta +8 -8
  880. package/Styles/Elements/Progress/ArcedProgressBar.cs +345 -345
  881. package/Styles/Elements/Progress/ArcedProgressBar.cs.meta +2 -2
  882. package/Styles/Elements/Progress/CircularProgressBar.cs +307 -307
  883. package/Styles/Elements/Progress/CircularProgressBar.cs.meta +2 -2
  884. package/Styles/Elements/Progress/GlitchProgressBar.cs +416 -416
  885. package/Styles/Elements/Progress/GlitchProgressBar.cs.meta +2 -2
  886. package/Styles/Elements/Progress/LiquidProgressBar.cs +632 -632
  887. package/Styles/Elements/Progress/LiquidProgressBar.cs.meta +2 -2
  888. package/Styles/Elements/Progress/MarchingAntsProgressBar.cs +722 -722
  889. package/Styles/Elements/Progress/MarchingAntsProgressBar.cs.meta +2 -2
  890. package/Styles/Elements/Progress/RegularProgressBar.cs +405 -405
  891. package/Styles/Elements/Progress/RegularProgressBar.cs.meta +2 -2
  892. package/Styles/Elements/Progress/WigglyProgressBar.cs +837 -837
  893. package/Styles/Elements/Progress/WigglyProgressBar.cs.meta +2 -2
  894. package/Styles/Elements/Progress.meta +2 -2
  895. package/Styles/Elements.meta +2 -2
  896. package/Styles/USS/ArcedProgressBar.uss +18 -18
  897. package/Styles/USS/ArcedProgressBar.uss.meta +2 -2
  898. package/Styles/USS/CirclularProgressBar.uss +17 -17
  899. package/Styles/USS/CirclularProgressBar.uss.meta +2 -2
  900. package/Styles/USS/RegularProgressBar.uss +32 -32
  901. package/Styles/USS/RegularProgressBar.uss.meta +2 -2
  902. package/Styles/USS/WigglyProgressBar.uss +16 -16
  903. package/Styles/USS/WigglyProgressBar.uss.meta +2 -2
  904. package/Styles/USS.meta +2 -2
  905. package/Styles/WallstopStudios.UnityHelpers.Styles.asmdef +14 -17
  906. package/Styles/WallstopStudios.UnityHelpers.Styles.asmdef.meta +7 -7
  907. package/Styles.meta +2 -2
  908. package/THIRD_PARTY_NOTICES.md +74 -0
  909. package/THIRD_PARTY_NOTICES.md.meta +7 -0
  910. package/Tests/Editor/Attributes/AnimationEventHelpersTests.cs +171 -0
  911. package/Tests/Editor/Attributes/AnimationEventHelpersTests.cs.meta +11 -0
  912. package/Tests/Editor/Attributes.meta +8 -0
  913. package/Tests/Editor/Core/Attributes/RelationalComponentAssignerTests.cs +118 -0
  914. package/Tests/Editor/Core/Attributes/RelationalComponentAssignerTests.cs.meta +11 -0
  915. package/Tests/Editor/Core/Attributes.meta +8 -0
  916. package/Tests/Editor/Core.meta +8 -0
  917. package/Tests/Editor/Extensions/SerializedPropertyExtensionsTests.cs +194 -0
  918. package/Tests/Editor/Extensions/SerializedPropertyExtensionsTests.cs.meta +3 -0
  919. package/Tests/Editor/Extensions.meta +3 -0
  920. package/Tests/Editor/Helper/DummyScriptableObject.cs +6 -0
  921. package/Tests/Editor/Helper/DummyScriptableObject.cs.meta +3 -0
  922. package/Tests/Editor/Helper/HelpersTests.cs +101 -0
  923. package/Tests/Editor/Helper/HelpersTests.cs.meta +3 -0
  924. package/Tests/Editor/Helper/ObjectHelpersEditorTests.cs +63 -0
  925. package/Tests/Editor/Helper/ObjectHelpersEditorTests.cs.meta +11 -0
  926. package/Tests/Editor/Helper/PromptScope.cs +28 -0
  927. package/Tests/Editor/Helper/PromptScope.cs.meta +11 -0
  928. package/Tests/Editor/Helper/ReflectionHelpersEditorTests.cs +105 -0
  929. package/Tests/Editor/Helper/ReflectionHelpersEditorTests.cs.meta +11 -0
  930. package/Tests/Editor/Helper/SpriteHelpersTests.cs +334 -0
  931. package/Tests/Editor/Helper/SpriteHelpersTests.cs.meta +3 -0
  932. package/Tests/Editor/Helper/SpriteSettingsApplierAdditionalTests.cs +183 -0
  933. package/Tests/Editor/Helper/SpriteSettingsApplierAdditionalTests.cs.meta +11 -0
  934. package/Tests/Editor/Helper/SpriteSettingsApplierTests.cs +161 -0
  935. package/Tests/Editor/Helper/SpriteSettingsApplierTests.cs.meta +11 -0
  936. package/Tests/Editor/Helper.meta +3 -0
  937. package/Tests/Editor/Integrations/VContainer/VContainerIntegrationCompilationTests.cs +40 -0
  938. package/Tests/Editor/Integrations/VContainer/VContainerIntegrationCompilationTests.cs.meta +11 -0
  939. package/Tests/Editor/Integrations/VContainer/VContainerRelationalEntryPointTests.cs +81 -0
  940. package/Tests/Editor/Integrations/VContainer/VContainerRelationalEntryPointTests.cs.meta +11 -0
  941. package/Tests/Editor/Integrations/VContainer/VContainerRelationalHelpersTests.cs +170 -0
  942. package/Tests/Editor/Integrations/VContainer/VContainerRelationalHelpersTests.cs.meta +11 -0
  943. package/Tests/Editor/Integrations/VContainer/WallstopStudios.UnityHelpers.Tests.Editor.VContainer.asmdef +37 -0
  944. package/Tests/Editor/Integrations/VContainer/WallstopStudios.UnityHelpers.Tests.Editor.VContainer.asmdef.meta +7 -0
  945. package/Tests/Editor/Integrations/VContainer.meta +8 -0
  946. package/Tests/Editor/Integrations/Zenject/WallstopStudios.UnityHelpers.Tests.Editor.Zenject.asmdef +37 -0
  947. package/Tests/Editor/Integrations/Zenject/WallstopStudios.UnityHelpers.Tests.Editor.Zenject.asmdef.meta +7 -0
  948. package/Tests/Editor/Integrations/Zenject/ZenjectIntegrationCompilationTests.cs +40 -0
  949. package/Tests/Editor/Integrations/Zenject/ZenjectIntegrationCompilationTests.cs.meta +11 -0
  950. package/Tests/Editor/Integrations/Zenject/ZenjectRelationalHelpersTests.cs +131 -0
  951. package/Tests/Editor/Integrations/Zenject/ZenjectRelationalHelpersTests.cs.meta +11 -0
  952. package/Tests/Editor/Integrations/Zenject/ZenjectRelationalInitializerTests.cs +80 -0
  953. package/Tests/Editor/Integrations/Zenject/ZenjectRelationalInitializerTests.cs.meta +11 -0
  954. package/Tests/Editor/Integrations/Zenject.meta +8 -0
  955. package/Tests/Editor/Integrations.meta +8 -0
  956. package/Tests/Editor/MultiFileSelectorElementTests.cs +265 -0
  957. package/Tests/Editor/MultiFileSelectorElementTests.cs.meta +11 -0
  958. package/Tests/Editor/MultiFileSelectorPersistenceManagerTests.cs +100 -0
  959. package/Tests/Editor/MultiFileSelectorPersistenceManagerTests.cs.meta +11 -0
  960. package/Tests/Editor/PersistentDirectorySettingsTests.cs +59 -0
  961. package/Tests/Editor/PersistentDirectorySettingsTests.cs.meta +11 -0
  962. package/Tests/Editor/PrefabCheckerReportTests.cs +32 -0
  963. package/Tests/Editor/PrefabCheckerReportTests.cs.meta +11 -0
  964. package/Tests/Editor/Sprites/AnimationCopierFilterTests.cs +64 -0
  965. package/Tests/Editor/Sprites/AnimationCopierFilterTests.cs.meta +11 -0
  966. package/Tests/Editor/Sprites/AnimationCopierWindowTests.cs +199 -0
  967. package/Tests/Editor/Sprites/AnimationCopierWindowTests.cs.meta +11 -0
  968. package/Tests/Editor/Sprites/AnimationViewerWindowTests.cs +38 -0
  969. package/Tests/Editor/Sprites/AnimationViewerWindowTests.cs.meta +11 -0
  970. package/Tests/Editor/Sprites/ScriptableSpriteAtlasEditorTests.cs +108 -0
  971. package/Tests/Editor/Sprites/ScriptableSpriteAtlasEditorTests.cs.meta +11 -0
  972. package/Tests/Editor/Sprites/SpriteCropperAdditionalTests.cs +323 -0
  973. package/Tests/Editor/Sprites/SpriteCropperAdditionalTests.cs.meta +11 -0
  974. package/Tests/Editor/Sprites/SpriteCropperTests.cs +162 -0
  975. package/Tests/Editor/Sprites/SpriteCropperTests.cs.meta +11 -0
  976. package/Tests/Editor/Sprites/SpritePivotAdjusterAdditionalTests.cs +227 -0
  977. package/Tests/Editor/Sprites/SpritePivotAdjusterAdditionalTests.cs.meta +11 -0
  978. package/Tests/Editor/Sprites/SpritePivotAdjusterTests.cs +113 -0
  979. package/Tests/Editor/Sprites/SpritePivotAdjusterTests.cs.meta +11 -0
  980. package/Tests/Editor/Sprites/TexturePlatformNameHelperTests.cs +46 -0
  981. package/Tests/Editor/Sprites/TexturePlatformNameHelperTests.cs.meta +11 -0
  982. package/Tests/Editor/Sprites/TextureResizerWizardTests.cs +248 -0
  983. package/Tests/Editor/Sprites/TextureResizerWizardTests.cs.meta +11 -0
  984. package/Tests/Editor/Sprites/TextureSettingsApplierAPITests.cs +180 -0
  985. package/Tests/Editor/Sprites/TextureSettingsApplierAPITests.cs.meta +11 -0
  986. package/Tests/Editor/Sprites/TextureSettingsApplierWizardAdditionalTests.cs +295 -0
  987. package/Tests/Editor/Sprites/TextureSettingsApplierWizardAdditionalTests.cs.meta +11 -0
  988. package/Tests/Editor/Sprites/TextureSettingsApplierWizardTests.cs +134 -0
  989. package/Tests/Editor/Sprites/TextureSettingsApplierWizardTests.cs.meta +11 -0
  990. package/Tests/Editor/Sprites.meta +8 -0
  991. package/Tests/Editor/TestComponents/PrewarmTesterComponent.cs +10 -0
  992. package/Tests/Editor/TestComponents/PrewarmTesterComponent.cs.meta +11 -0
  993. package/Tests/Editor/TestComponents.meta +8 -0
  994. package/Tests/Editor/Tools/ImageBlurToolTests.cs +47 -0
  995. package/Tests/Editor/Tools/ImageBlurToolTests.cs.meta +11 -0
  996. package/Tests/Editor/Tools.meta +8 -0
  997. package/Tests/Editor/Utils/CommonTestBase.cs +250 -0
  998. package/Tests/Editor/Utils/CommonTestBase.cs.meta +11 -0
  999. package/Tests/Editor/Utils/ScriptableObjectSingletonCreatorEditorTests.cs +306 -0
  1000. package/Tests/Editor/Utils/ScriptableObjectSingletonCreatorEditorTests.cs.meta +9 -0
  1001. package/Tests/Editor/Utils/ScriptableObjectSingletonCreatorTests.cs +183 -0
  1002. package/Tests/Editor/Utils/ScriptableObjectSingletonCreatorTests.cs.meta +11 -0
  1003. package/Tests/Editor/Utils/ScriptableObjectSingletonTests.cs +466 -0
  1004. package/Tests/Editor/Utils/ScriptableObjectSingletonTests.cs.meta +11 -0
  1005. package/Tests/Editor/Utils.meta +3 -0
  1006. package/Tests/Editor/WallstopStudios.UnityHelpers.Tests.Editor.asmdef +19 -0
  1007. package/Tests/Editor/WallstopStudios.UnityHelpers.Tests.Editor.asmdef.meta +7 -0
  1008. package/Tests/Editor/Windows/FitTextureSizeWindowTests.cs +773 -0
  1009. package/Tests/Editor/Windows/FitTextureSizeWindowTests.cs.meta +11 -0
  1010. package/Tests/Editor/Windows/PrefabCheckerFolderAdditionTests.cs +96 -0
  1011. package/Tests/Editor/Windows/PrefabCheckerFolderAdditionTests.cs.meta +11 -0
  1012. package/Tests/Editor/Windows/PrefabCheckerTests.cs +81 -0
  1013. package/Tests/Editor/Windows/PrefabCheckerTests.cs.meta +11 -0
  1014. package/Tests/Editor/Windows.meta +8 -0
  1015. package/Tests/Editor.meta +8 -0
  1016. package/Tests/Runtime/AssemblyInfo.cs +4 -0
  1017. package/Tests/Runtime/AssemblyInfo.cs.meta +3 -0
  1018. package/Tests/Runtime/Attributes/ChildComponentTests.cs +766 -81
  1019. package/Tests/Runtime/Attributes/ChildComponentTests.cs.meta +2 -2
  1020. package/Tests/Runtime/Attributes/Components/ExpectChildSpriteRenderers.cs +28 -28
  1021. package/Tests/Runtime/Attributes/Components/ExpectChildSpriteRenderers.cs.meta +2 -2
  1022. package/Tests/Runtime/Attributes/Components/ExpectParentSpriteRenderers.cs +28 -28
  1023. package/Tests/Runtime/Attributes/Components/ExpectParentSpriteRenderers.cs.meta +2 -2
  1024. package/Tests/Runtime/{Components → Attributes/Components}/RelationalComponentTesterComplex.cs +34 -34
  1025. package/Tests/Runtime/{Components → Attributes/Components}/RelationalComponentTesterComplex.cs.meta +2 -2
  1026. package/Tests/Runtime/Attributes/Components/RelationalComponentsTesterSimple.cs +37 -0
  1027. package/Tests/Runtime/{Components → Attributes/Components}/RelationalComponentsTesterSimple.cs.meta +2 -2
  1028. package/Tests/Runtime/Attributes/Components.meta +2 -2
  1029. package/Tests/Runtime/Attributes/MiscRuntimeAttributeTests.cs +75 -0
  1030. package/Tests/Runtime/Attributes/MiscRuntimeAttributeTests.cs.meta +11 -0
  1031. package/Tests/Runtime/Attributes/NotNullAttributeTests.cs +26 -0
  1032. package/Tests/Runtime/Attributes/NotNullAttributeTests.cs.meta +3 -0
  1033. package/Tests/Runtime/Attributes/ParentComponentTests.cs +565 -68
  1034. package/Tests/Runtime/Attributes/ParentComponentTests.cs.meta +2 -2
  1035. package/Tests/Runtime/Attributes/RelationalComponentAdvancedTests.cs +614 -0
  1036. package/Tests/Runtime/Attributes/RelationalComponentAdvancedTests.cs.meta +11 -0
  1037. package/Tests/Runtime/Attributes/RelationalComponentBackwardCompatibilityTests.cs +478 -0
  1038. package/Tests/Runtime/Attributes/RelationalComponentBackwardCompatibilityTests.cs.meta +11 -0
  1039. package/Tests/Runtime/Attributes/RelationalComponentExtensionsTests.cs +56 -0
  1040. package/Tests/Runtime/Attributes/RelationalComponentExtensionsTests.cs.meta +11 -0
  1041. package/Tests/Runtime/Attributes/RelationalComponentHashSetTests.cs +226 -0
  1042. package/Tests/Runtime/Attributes/RelationalComponentHashSetTests.cs.meta +11 -0
  1043. package/Tests/Runtime/Attributes/RelationalComponentInitializerTests.cs +98 -0
  1044. package/Tests/Runtime/Attributes/RelationalComponentInitializerTests.cs.meta +11 -0
  1045. package/Tests/Runtime/Attributes/RelationalComponentTagAndNameFilterEdgeTests.cs +234 -0
  1046. package/Tests/Runtime/Attributes/RelationalComponentTagAndNameFilterEdgeTests.cs.meta +11 -0
  1047. package/Tests/Runtime/Attributes/SiblingComponentTests.cs +721 -0
  1048. package/Tests/Runtime/Attributes/SiblingComponentTests.cs.meta +11 -0
  1049. package/Tests/Runtime/Attributes/ValidateAssignmentAttributeTests.cs +96 -0
  1050. package/Tests/Runtime/Attributes/ValidateAssignmentAttributeTests.cs.meta +11 -0
  1051. package/Tests/Runtime/Attributes.meta +2 -2
  1052. package/Tests/Runtime/Core/Random/RandomComparerTests.cs +166 -0
  1053. package/Tests/Runtime/Core/Random/RandomComparerTests.cs.meta +11 -0
  1054. package/Tests/Runtime/Core/Random.meta +8 -0
  1055. package/Tests/Runtime/Core/Threading/SingleThreadedThreadPoolTests.cs +56 -56
  1056. package/Tests/Runtime/Core/Threading/SingleThreadedThreadPoolTests.cs.meta +2 -2
  1057. package/Tests/Runtime/Core/Threading.meta +2 -2
  1058. package/Tests/Runtime/Core.meta +2 -2
  1059. package/Tests/Runtime/DataStructures/BalancedKDTree2DTests.cs +562 -0
  1060. package/Tests/Runtime/DataStructures/{BalancedKDTreeTests.cs.meta → BalancedKDTree2DTests.cs.meta} +11 -11
  1061. package/Tests/Runtime/DataStructures/BalancedKDTree3DTests.cs +10 -0
  1062. package/Tests/Runtime/DataStructures/BalancedKDTree3DTests.cs.meta +11 -0
  1063. package/Tests/Runtime/DataStructures/BitSetTests.cs +1400 -0
  1064. package/Tests/Runtime/DataStructures/BitSetTests.cs.meta +3 -0
  1065. package/Tests/Runtime/DataStructures/BoundingBox3DTests.cs +1215 -0
  1066. package/Tests/Runtime/DataStructures/BoundingBox3DTests.cs.meta +11 -0
  1067. package/Tests/Runtime/DataStructures/CircleTests.cs +965 -0
  1068. package/Tests/Runtime/DataStructures/CircleTests.cs.meta +11 -0
  1069. package/Tests/Runtime/DataStructures/CyclicBufferTests.cs +2083 -324
  1070. package/Tests/Runtime/DataStructures/CyclicBufferTests.cs.meta +2 -2
  1071. package/Tests/Runtime/DataStructures/DequeTests.cs +790 -0
  1072. package/Tests/Runtime/DataStructures/DequeTests.cs.meta +3 -0
  1073. package/Tests/Runtime/DataStructures/DisjointSetTests.cs +1114 -0
  1074. package/Tests/Runtime/DataStructures/DisjointSetTests.cs.meta +3 -0
  1075. package/Tests/Runtime/DataStructures/FastOneOfTests.cs +966 -0
  1076. package/Tests/Runtime/DataStructures/FastOneOfTests.cs.meta +11 -0
  1077. package/Tests/Runtime/DataStructures/FastVector2IntTests.cs +286 -0
  1078. package/Tests/Runtime/DataStructures/FastVector2IntTests.cs.meta +11 -0
  1079. package/Tests/Runtime/DataStructures/FastVector3IntTests.cs +414 -0
  1080. package/Tests/Runtime/DataStructures/FastVector3IntTests.cs.meta +11 -0
  1081. package/Tests/Runtime/DataStructures/HeapTests.cs +1953 -0
  1082. package/Tests/Runtime/DataStructures/HeapTests.cs.meta +11 -0
  1083. package/Tests/Runtime/DataStructures/ImmutableBitSetTests.cs +833 -0
  1084. package/Tests/Runtime/DataStructures/ImmutableBitSetTests.cs.meta +3 -0
  1085. package/Tests/Runtime/DataStructures/KDTree3DTestsBase.cs +297 -0
  1086. package/Tests/Runtime/DataStructures/KDTree3DTestsBase.cs.meta +11 -0
  1087. package/Tests/Runtime/DataStructures/OctTree3DTests.cs +351 -0
  1088. package/Tests/Runtime/DataStructures/OctTree3DTests.cs.meta +11 -0
  1089. package/Tests/Runtime/DataStructures/PriorityQueueTests.cs +71 -0
  1090. package/Tests/Runtime/DataStructures/PriorityQueueTests.cs.meta +3 -0
  1091. package/Tests/Runtime/DataStructures/ProtobufSerializationTests.cs +475 -0
  1092. package/Tests/Runtime/DataStructures/ProtobufSerializationTests.cs.meta +11 -0
  1093. package/Tests/Runtime/DataStructures/QuadTree2DTests.cs +660 -0
  1094. package/Tests/Runtime/DataStructures/QuadTree2DTests.cs.meta +11 -0
  1095. package/Tests/Runtime/DataStructures/RTree2DTests.cs +823 -0
  1096. package/Tests/Runtime/DataStructures/RTree2DTests.cs.meta +3 -0
  1097. package/Tests/Runtime/DataStructures/RTree3DTests.cs +270 -0
  1098. package/Tests/Runtime/DataStructures/RTree3DTests.cs.meta +11 -0
  1099. package/Tests/Runtime/DataStructures/SparseSetTests.cs +1146 -0
  1100. package/Tests/Runtime/DataStructures/SparseSetTests.cs.meta +3 -0
  1101. package/Tests/Runtime/DataStructures/SpatialHashTests.cs +992 -0
  1102. package/Tests/Runtime/DataStructures/SpatialHashTests.cs.meta +11 -0
  1103. package/Tests/Runtime/DataStructures/SpatialTree2DBoundsConsistencyTests.cs +351 -0
  1104. package/Tests/Runtime/DataStructures/SpatialTree2DBoundsConsistencyTests.cs.meta +11 -0
  1105. package/Tests/Runtime/DataStructures/SpatialTree2DBoundsEdgeTests.cs +127 -0
  1106. package/Tests/Runtime/DataStructures/SpatialTree2DBoundsEdgeTests.cs.meta +11 -0
  1107. package/Tests/Runtime/DataStructures/SpatialTree2DBoundsFuzzTests.cs +218 -0
  1108. package/Tests/Runtime/DataStructures/SpatialTree2DBoundsFuzzTests.cs.meta +11 -0
  1109. package/Tests/Runtime/DataStructures/SpatialTree2DTests.cs +396 -0
  1110. package/Tests/Runtime/DataStructures/SpatialTree2DTests.cs.meta +11 -0
  1111. package/Tests/Runtime/DataStructures/SpatialTree3DBoundsConsistencyTests.cs +281 -0
  1112. package/Tests/Runtime/DataStructures/SpatialTree3DBoundsConsistencyTests.cs.meta +11 -0
  1113. package/Tests/Runtime/DataStructures/SpatialTree3DBoundsEdgeTests.cs +127 -0
  1114. package/Tests/Runtime/DataStructures/SpatialTree3DBoundsEdgeTests.cs.meta +11 -0
  1115. package/Tests/Runtime/DataStructures/SpatialTree3DBoundsFuzzTests.cs +170 -0
  1116. package/Tests/Runtime/DataStructures/SpatialTree3DBoundsFuzzTests.cs.meta +11 -0
  1117. package/Tests/Runtime/DataStructures/SpatialTree3DTests.cs +474 -0
  1118. package/Tests/Runtime/DataStructures/SpatialTree3DTests.cs.meta +11 -0
  1119. package/Tests/Runtime/DataStructures/SphereTests.cs +806 -0
  1120. package/Tests/Runtime/DataStructures/SphereTests.cs.meta +3 -0
  1121. package/Tests/Runtime/DataStructures/StringWrapperTests.cs +333 -0
  1122. package/Tests/Runtime/DataStructures/StringWrapperTests.cs.meta +11 -0
  1123. package/Tests/Runtime/DataStructures/TimedCacheTests.cs +669 -0
  1124. package/Tests/Runtime/DataStructures/TimedCacheTests.cs.meta +11 -0
  1125. package/Tests/Runtime/DataStructures/TrieTests.cs +3385 -0
  1126. package/Tests/Runtime/DataStructures/TrieTests.cs.meta +11 -0
  1127. package/Tests/Runtime/DataStructures/UnbalancedKDTree2DTests.cs +565 -0
  1128. package/Tests/Runtime/DataStructures/{UnbalancedKDTreeTests.cs.meta → UnbalancedKDTree2DTests.cs.meta} +11 -11
  1129. package/Tests/Runtime/DataStructures/UnbalancedKDTree3DTests.cs +10 -0
  1130. package/Tests/Runtime/DataStructures/UnbalancedKDTree3DTests.cs.meta +11 -0
  1131. package/Tests/Runtime/DataStructures.meta +8 -8
  1132. package/Tests/Runtime/Extensions/AnimatorExtensionsTests.cs +28 -0
  1133. package/Tests/Runtime/Extensions/AnimatorExtensionsTests.cs.meta +11 -0
  1134. package/Tests/Runtime/Extensions/AsyncOperationExtensionsTests.cs +667 -0
  1135. package/Tests/Runtime/Extensions/AsyncOperationExtensionsTests.cs.meta +11 -0
  1136. package/Tests/Runtime/Extensions/CircleExtensionsTests.cs +230 -0
  1137. package/Tests/Runtime/Extensions/CircleExtensionsTests.cs.meta +11 -0
  1138. package/Tests/Runtime/Extensions/ColorExtensionsTests.cs +55 -0
  1139. package/Tests/Runtime/Extensions/ColorExtensionsTests.cs.meta +11 -0
  1140. package/Tests/Runtime/Extensions/DictionaryExtensionTests.cs +724 -438
  1141. package/Tests/Runtime/Extensions/DictionaryExtensionTests.cs.meta +2 -2
  1142. package/Tests/Runtime/Extensions/DirectionExtensionsComprehensiveTests.cs +403 -0
  1143. package/Tests/Runtime/Extensions/DirectionExtensionsComprehensiveTests.cs.meta +11 -0
  1144. package/Tests/Runtime/Extensions/DirectionExtensionsTests.cs +69 -0
  1145. package/Tests/Runtime/Extensions/DirectionExtensionsTests.cs.meta +11 -0
  1146. package/Tests/Runtime/Extensions/EnumExtensionTests.cs +809 -153
  1147. package/Tests/Runtime/Extensions/EnumExtensionTests.cs.meta +2 -2
  1148. package/Tests/Runtime/Extensions/IEnumerableExtensionsTests.cs +191 -0
  1149. package/Tests/Runtime/Extensions/IEnumerableExtensionsTests.cs.meta +11 -0
  1150. package/Tests/Runtime/Extensions/IListExtensionTests.cs +955 -169
  1151. package/Tests/Runtime/Extensions/IListExtensionTests.cs.meta +2 -2
  1152. package/Tests/Runtime/Extensions/IReadonlyListExtensionTests.cs +266 -58
  1153. package/Tests/Runtime/Extensions/IReadonlyListExtensionTests.cs.meta +2 -2
  1154. package/Tests/Runtime/Extensions/LoggingExtensionTests.cs +721 -718
  1155. package/Tests/Runtime/Extensions/LoggingExtensionTests.cs.meta +2 -2
  1156. package/Tests/Runtime/Extensions/ProtoEqualityExtensionsTests.cs +565 -0
  1157. package/Tests/Runtime/Extensions/ProtoEqualityExtensionsTests.cs.meta +3 -0
  1158. package/Tests/Runtime/Extensions/ProtoEqualityPolymorphismTests.cs +100 -0
  1159. package/Tests/Runtime/Extensions/ProtoEqualityPolymorphismTests.cs.meta +11 -0
  1160. package/Tests/Runtime/Extensions/RandomExtensionTests.cs +719 -27
  1161. package/Tests/Runtime/Extensions/RandomExtensionTests.cs.meta +2 -2
  1162. package/Tests/Runtime/Extensions/StringExtensionTests.cs +2592 -31
  1163. package/Tests/Runtime/Extensions/StringExtensionTests.cs.meta +2 -2
  1164. package/Tests/Runtime/Extensions/UnityExtensionsBasicTests.cs +166 -0
  1165. package/Tests/Runtime/Extensions/UnityExtensionsBasicTests.cs.meta +11 -0
  1166. package/Tests/Runtime/Extensions/UnityExtensionsComprehensiveTests.cs +1446 -0
  1167. package/Tests/Runtime/Extensions/UnityExtensionsComprehensiveTests.cs.meta +11 -0
  1168. package/Tests/Runtime/Extensions/UnityExtensionsMathTests.cs +1779 -0
  1169. package/Tests/Runtime/Extensions/UnityExtensionsMathTests.cs.meta +11 -0
  1170. package/Tests/Runtime/Extensions/UnityExtensionsVector2HullTests.cs +292 -0
  1171. package/Tests/Runtime/Extensions/UnityExtensionsVector2HullTests.cs.meta +11 -0
  1172. package/Tests/Runtime/Extensions/UnityLogTagFormatterEdgeTests.cs +260 -0
  1173. package/Tests/Runtime/Extensions/UnityLogTagFormatterEdgeTests.cs.meta +11 -0
  1174. package/Tests/Runtime/Extensions.meta +2 -2
  1175. package/Tests/Runtime/Helper/ArrayConverterTests.cs +19 -19
  1176. package/Tests/Runtime/Helper/ArrayConverterTests.cs.meta +2 -2
  1177. package/Tests/Runtime/Helper/AssignUtilitiesTests.cs +38 -0
  1178. package/Tests/Runtime/Helper/AssignUtilitiesTests.cs.meta +11 -0
  1179. package/Tests/Runtime/Helper/DirectoryHelperTests.cs +347 -0
  1180. package/Tests/Runtime/Helper/DirectoryHelperTests.cs.meta +11 -0
  1181. package/Tests/Runtime/Helper/EnumerablesTests.cs +45 -0
  1182. package/Tests/Runtime/Helper/EnumerablesTests.cs.meta +11 -0
  1183. package/Tests/Runtime/Helper/FileHelperTests.cs +481 -0
  1184. package/Tests/Runtime/Helper/FileHelperTests.cs.meta +11 -0
  1185. package/Tests/Runtime/Helper/FormattingHelpersTests.cs +353 -0
  1186. package/Tests/Runtime/Helper/FormattingHelpersTests.cs.meta +11 -0
  1187. package/Tests/Runtime/Helper/FuncBasedComparerTests.cs +27 -0
  1188. package/Tests/Runtime/Helper/FuncBasedComparerTests.cs.meta +11 -0
  1189. package/Tests/Runtime/Helper/GeometryTests.cs +517 -0
  1190. package/Tests/Runtime/Helper/GeometryTests.cs.meta +3 -0
  1191. package/Tests/Runtime/Helper/HelpersTests.cs +749 -0
  1192. package/Tests/Runtime/Helper/HelpersTests.cs.meta +11 -0
  1193. package/Tests/Runtime/Helper/IterationHelpersTests.cs +173 -0
  1194. package/Tests/Runtime/Helper/IterationHelpersTests.cs.meta +11 -0
  1195. package/Tests/Runtime/Helper/LineHelperTests.cs +662 -0
  1196. package/Tests/Runtime/Helper/LineHelperTests.cs.meta +11 -0
  1197. package/Tests/Runtime/Helper/ObjectHelperTests.cs +444 -432
  1198. package/Tests/Runtime/Helper/ObjectHelperTests.cs.meta +2 -2
  1199. package/Tests/Runtime/Helper/ObjectsTests.cs +363 -0
  1200. package/Tests/Runtime/Helper/ObjectsTests.cs.meta +3 -0
  1201. package/Tests/Runtime/Helper/PathHelperTests.cs +183 -0
  1202. package/Tests/Runtime/Helper/PathHelperTests.cs.meta +11 -0
  1203. package/Tests/Runtime/Helper/ReflectionHelperTests.cs +2199 -1493
  1204. package/Tests/Runtime/Helper/ReflectionHelperTests.cs.meta +2 -2
  1205. package/Tests/Runtime/Helper/ReflectionHelpersMemberLookupTests.cs +192 -0
  1206. package/Tests/Runtime/Helper/ReflectionHelpersMemberLookupTests.cs.meta +11 -0
  1207. package/Tests/Runtime/Helper/ReflectionHelpersTypeScanningTests.cs +58 -0
  1208. package/Tests/Runtime/Helper/ReflectionHelpersTypeScanningTests.cs.meta +11 -0
  1209. package/Tests/Runtime/Helper/SceneHelperTests.cs +77 -94
  1210. package/Tests/Runtime/Helper/SceneHelperTests.cs.meta +2 -2
  1211. package/Tests/Runtime/Helper/UnityMainThreadDispatcherTests.cs +45 -0
  1212. package/Tests/Runtime/Helper/UnityMainThreadDispatcherTests.cs.meta +11 -0
  1213. package/Tests/Runtime/Helper/WallMathTests.cs +1884 -233
  1214. package/Tests/Runtime/Helper/WallMathTests.cs.meta +2 -2
  1215. package/Tests/Runtime/Helper.meta +2 -2
  1216. package/Tests/Runtime/Integrations/VContainer/RelationalComponentsVContainerTests.cs +601 -0
  1217. package/Tests/Runtime/Integrations/VContainer/RelationalComponentsVContainerTests.cs.meta +11 -0
  1218. package/Tests/Runtime/Integrations/VContainer/RelationalObjectPoolsVContainerTests.cs +86 -0
  1219. package/Tests/Runtime/Integrations/VContainer/RelationalObjectPoolsVContainerTests.cs.meta +11 -0
  1220. package/Tests/Runtime/Integrations/VContainer/WallstopStudios.UnityHelpers.Tests.Runtime.VContainer.asmdef +38 -0
  1221. package/Tests/Runtime/Integrations/VContainer/WallstopStudios.UnityHelpers.Tests.Runtime.VContainer.asmdef.meta +7 -0
  1222. package/Tests/Runtime/Integrations/VContainer.meta +8 -0
  1223. package/Tests/Runtime/Integrations/Zenject/RelationalComponentsZenjectTests.cs +619 -0
  1224. package/Tests/Runtime/Integrations/Zenject/RelationalComponentsZenjectTests.cs.meta +11 -0
  1225. package/Tests/Runtime/Integrations/Zenject/WallstopStudios.UnityHelpers.Tests.Runtime.Zenject.asmdef +38 -0
  1226. package/Tests/Runtime/Integrations/Zenject/WallstopStudios.UnityHelpers.Tests.Runtime.Zenject.asmdef.meta +7 -0
  1227. package/Tests/Runtime/Integrations/Zenject.meta +8 -0
  1228. package/Tests/Runtime/Integrations.meta +8 -0
  1229. package/Tests/Runtime/Math/Line2DTests.cs +594 -0
  1230. package/Tests/Runtime/Math/Line2DTests.cs.meta +11 -0
  1231. package/Tests/Runtime/Math/Line3DTests.cs +655 -0
  1232. package/Tests/Runtime/Math/Line3DTests.cs.meta +11 -0
  1233. package/Tests/Runtime/Math/LineTests.cs +480 -0
  1234. package/Tests/Runtime/Math/LineTests.cs.meta +11 -0
  1235. package/Tests/Runtime/Math/ParabolaTests.cs +477 -0
  1236. package/Tests/Runtime/Math/ParabolaTests.cs.meta +11 -0
  1237. package/Tests/Runtime/Math/PointPolygonCheckTests.cs +939 -0
  1238. package/Tests/Runtime/Math/PointPolygonCheckTests.cs.meta +11 -0
  1239. package/Tests/Runtime/Math/RangeTests.cs +197 -0
  1240. package/Tests/Runtime/Math/RangeTests.cs.meta +11 -0
  1241. package/Tests/Runtime/Math.meta +8 -0
  1242. package/Tests/Runtime/Performance/BenchmarkReadmeUpdater.cs +81 -0
  1243. package/Tests/Runtime/Performance/BenchmarkReadmeUpdater.cs.meta +11 -0
  1244. package/Tests/Runtime/Performance/JsonSerializationPerformanceTests.cs +421 -0
  1245. package/Tests/Runtime/Performance/JsonSerializationPerformanceTests.cs.meta +3 -0
  1246. package/Tests/Runtime/Performance/ListExtensionPerformanceTests.cs +76 -76
  1247. package/Tests/Runtime/Performance/ListExtensionPerformanceTests.cs.meta +2 -2
  1248. package/Tests/Runtime/Performance/ProtoEqualsPerformanceTests.cs +161 -0
  1249. package/Tests/Runtime/Performance/ProtoEqualsPerformanceTests.cs.meta +11 -0
  1250. package/Tests/Runtime/Performance/ProtoSerializationPerformanceTests.cs +207 -0
  1251. package/Tests/Runtime/Performance/ProtoSerializationPerformanceTests.cs.meta +3 -0
  1252. package/Tests/Runtime/Performance/RandomPerformanceTests.cs +195 -181
  1253. package/Tests/Runtime/Performance/RandomPerformanceTests.cs.meta +11 -11
  1254. package/Tests/Runtime/Performance/RelationComponentPerformanceTests.cs +60 -61
  1255. package/Tests/Runtime/Performance/RelationComponentPerformanceTests.cs.meta +2 -2
  1256. package/Tests/Runtime/Performance/SpatialTree2DPerformanceTests.cs +697 -0
  1257. package/Tests/Runtime/Performance/SpatialTree2DPerformanceTests.cs.meta +11 -0
  1258. package/Tests/Runtime/Performance/SpatialTree3DPerformanceTests.cs +653 -0
  1259. package/Tests/Runtime/Performance/SpatialTree3DPerformanceTests.cs.meta +11 -0
  1260. package/Tests/Runtime/Performance.meta +8 -8
  1261. package/Tests/Runtime/Random/DotNetRandomTests.cs +9 -9
  1262. package/Tests/Runtime/Random/DotNetRandomTests.cs.meta +2 -2
  1263. package/Tests/Runtime/Random/IllusionFlowTests.cs +12 -12
  1264. package/Tests/Runtime/Random/IllusionFlowTests.cs.meta +2 -2
  1265. package/Tests/Runtime/Random/LinearCongruentialGeneratorTests.cs +12 -12
  1266. package/Tests/Runtime/Random/LinearCongruentialGeneratorTests.cs.meta +2 -2
  1267. package/Tests/Runtime/Random/PcgRandomTests.cs +9 -9
  1268. package/Tests/Runtime/Random/PcgRandomTests.cs.meta +11 -11
  1269. package/Tests/Runtime/Random/RandomProtoSerializationTests.cs +494 -0
  1270. package/Tests/Runtime/Random/RandomProtoSerializationTests.cs.meta +3 -0
  1271. package/Tests/Runtime/Random/RandomStateSerializationTests.cs +304 -0
  1272. package/Tests/Runtime/Random/RandomStateSerializationTests.cs.meta +4 -0
  1273. package/Tests/Runtime/Random/RandomTestBase.cs +836 -787
  1274. package/Tests/Runtime/Random/RandomTestBase.cs.meta +11 -11
  1275. package/Tests/Runtime/Random/RomuDuoRandomTests.cs +9 -9
  1276. package/Tests/Runtime/Random/RomuDuoRandomTests.cs.meta +2 -2
  1277. package/Tests/Runtime/Random/SplitMix64RandomTests.cs +9 -9
  1278. package/Tests/Runtime/Random/SplitMix64RandomTests.cs.meta +2 -2
  1279. package/Tests/Runtime/Random/SquirrelRandomTests.cs +14 -14
  1280. package/Tests/Runtime/Random/SquirrelRandomTests.cs.meta +11 -11
  1281. package/Tests/Runtime/Random/SystemRandomTests.cs +10 -10
  1282. package/Tests/Runtime/Random/SystemRandomTests.cs.meta +11 -11
  1283. package/Tests/Runtime/Random/UnityRandomTests.cs +9 -9
  1284. package/Tests/Runtime/Random/UnityRandomTests.cs.meta +11 -11
  1285. package/Tests/Runtime/Random/WyRandomTests.cs +9 -9
  1286. package/Tests/Runtime/Random/WyRandomTests.cs.meta +2 -2
  1287. package/Tests/Runtime/Random/XorShiftRandomTests.cs +9 -9
  1288. package/Tests/Runtime/Random/XorShiftRandomTests.cs.meta +11 -11
  1289. package/Tests/Runtime/Random/XoroShiroRandomTests.cs +9 -9
  1290. package/Tests/Runtime/Random/XoroShiroRandomTests.cs.meta +2 -2
  1291. package/Tests/Runtime/Random.meta +8 -8
  1292. package/Tests/Runtime/RuntimeTestTimeouts.cs +3 -0
  1293. package/Tests/Runtime/RuntimeTestTimeouts.cs.meta +11 -0
  1294. package/Tests/Runtime/Scenes/Test1.unity +723 -723
  1295. package/Tests/Runtime/Scenes/Test1.unity.meta +7 -7
  1296. package/Tests/Runtime/Scenes/Test2.unity +723 -723
  1297. package/Tests/Runtime/Scenes/Test2.unity.meta +7 -7
  1298. package/Tests/Runtime/Scenes.meta +2 -2
  1299. package/Tests/Runtime/Serialization/AdaptersJsonTests.cs +67 -0
  1300. package/Tests/Runtime/Serialization/AdaptersJsonTests.cs.meta +11 -0
  1301. package/Tests/Runtime/Serialization/BitSetJsonTests.cs +50 -0
  1302. package/Tests/Runtime/Serialization/BitSetJsonTests.cs.meta +11 -0
  1303. package/Tests/Runtime/Serialization/CyclicBufferJsonTests.cs +67 -0
  1304. package/Tests/Runtime/Serialization/CyclicBufferJsonTests.cs.meta +11 -0
  1305. package/Tests/Runtime/Serialization/DequeJsonTests.cs +70 -0
  1306. package/Tests/Runtime/Serialization/DequeJsonTests.cs.meta +11 -0
  1307. package/Tests/Runtime/Serialization/ImmutableBitSetJsonTests.cs +25 -0
  1308. package/Tests/Runtime/Serialization/ImmutableBitSetJsonTests.cs.meta +11 -0
  1309. package/Tests/Runtime/Serialization/JsonConverterAdditionalTests.cs +30 -0
  1310. package/Tests/Runtime/Serialization/JsonConverterAdditionalTests.cs.meta +11 -0
  1311. package/Tests/Runtime/Serialization/JsonConverterTests.cs +1153 -0
  1312. package/Tests/Runtime/Serialization/JsonConverterTests.cs.meta +11 -0
  1313. package/Tests/Runtime/Serialization/JsonRoundtripComprehensiveTests.cs +239 -0
  1314. package/Tests/Runtime/Serialization/JsonRoundtripComprehensiveTests.cs.meta +11 -0
  1315. package/Tests/Runtime/Serialization/JsonSerializationCorrectnessTests.cs +458 -0
  1316. package/Tests/Runtime/Serialization/JsonSerializationCorrectnessTests.cs.meta +3 -0
  1317. package/Tests/Runtime/Serialization/JsonSerializationTest.cs +167 -156
  1318. package/Tests/Runtime/Serialization/JsonSerializationTest.cs.meta +2 -2
  1319. package/Tests/Runtime/Serialization/MathJsonTests.cs +79 -0
  1320. package/Tests/Runtime/Serialization/MathJsonTests.cs.meta +11 -0
  1321. package/Tests/Runtime/Serialization/ProtoInterfaceResolutionEdgeTests.cs +76 -0
  1322. package/Tests/Runtime/Serialization/ProtoInterfaceResolutionEdgeTests.cs.meta +11 -0
  1323. package/Tests/Runtime/Serialization/ProtoRootRegistrationTests.cs +80 -0
  1324. package/Tests/Runtime/Serialization/ProtoRootRegistrationTests.cs.meta +11 -0
  1325. package/Tests/Runtime/Serialization/ProtoRoundtripComprehensiveTests.cs +257 -0
  1326. package/Tests/Runtime/Serialization/ProtoRoundtripComprehensiveTests.cs.meta +11 -0
  1327. package/Tests/Runtime/Serialization/ProtoSerializationCorrectnessTests.cs +471 -0
  1328. package/Tests/Runtime/Serialization/ProtoSerializationCorrectnessTests.cs.meta +3 -0
  1329. package/Tests/Runtime/Serialization/ProtoSerializationTests.cs +169 -0
  1330. package/Tests/Runtime/Serialization/ProtoSerializationTests.cs.meta +11 -0
  1331. package/Tests/Runtime/Serialization/ProtoSerializeBehaviorTests.cs +62 -0
  1332. package/Tests/Runtime/Serialization/ProtoSerializeBehaviorTests.cs.meta +11 -0
  1333. package/Tests/Runtime/Serialization/SerializerAdditionalTests.cs +907 -0
  1334. package/Tests/Runtime/Serialization/SerializerAdditionalTests.cs.meta +3 -0
  1335. package/Tests/Runtime/Serialization/SerializerFileIoTests.cs +105 -0
  1336. package/Tests/Runtime/Serialization/SerializerFileIoTests.cs.meta +11 -0
  1337. package/Tests/Runtime/Serialization/TypeConverterTests.cs +34 -0
  1338. package/Tests/Runtime/Serialization/TypeConverterTests.cs.meta +11 -0
  1339. package/Tests/Runtime/Serialization/UnityEngineObjectJsonTests.cs +247 -0
  1340. package/Tests/Runtime/Serialization/UnityEngineObjectJsonTests.cs.meta +11 -0
  1341. package/Tests/Runtime/Serialization.meta +2 -2
  1342. package/Tests/Runtime/Tags/AttributeComponentTests.cs +174 -0
  1343. package/Tests/Runtime/Tags/AttributeComponentTests.cs.meta +3 -0
  1344. package/Tests/Runtime/Tags/AttributeDataTests.cs +312 -0
  1345. package/Tests/Runtime/Tags/AttributeDataTests.cs.meta +11 -0
  1346. package/Tests/Runtime/Tags/AttributeUtilitiesTests.cs +405 -0
  1347. package/Tests/Runtime/Tags/AttributeUtilitiesTests.cs.meta +3 -0
  1348. package/Tests/Runtime/Tags/CosmeticAndCollisionTests.cs +147 -0
  1349. package/Tests/Runtime/Tags/CosmeticAndCollisionTests.cs.meta +11 -0
  1350. package/Tests/Runtime/Tags/CosmeticEffectDataTests.cs +60 -0
  1351. package/Tests/Runtime/Tags/CosmeticEffectDataTests.cs.meta +3 -0
  1352. package/Tests/Runtime/Tags/EffectHandleTests.cs +61 -0
  1353. package/Tests/Runtime/Tags/EffectHandleTests.cs.meta +3 -0
  1354. package/Tests/Runtime/Tags/EffectHandlerTests.cs +270 -0
  1355. package/Tests/Runtime/Tags/EffectHandlerTests.cs.meta +3 -0
  1356. package/Tests/Runtime/Tags/Helpers/RecordingCosmeticComponent.cs +39 -0
  1357. package/Tests/Runtime/Tags/Helpers/RecordingCosmeticComponent.cs.meta +3 -0
  1358. package/Tests/Runtime/Tags/Helpers/TagTestBase.cs +49 -0
  1359. package/Tests/Runtime/Tags/Helpers/TagTestBase.cs.meta +3 -0
  1360. package/Tests/Runtime/Tags/Helpers/TestAttributesComponent.cs +28 -0
  1361. package/Tests/Runtime/Tags/Helpers/TestAttributesComponent.cs.meta +3 -0
  1362. package/Tests/Runtime/Tags/Helpers.meta +3 -0
  1363. package/Tests/Runtime/Tags/TagHandlerTests.cs +108 -0
  1364. package/Tests/Runtime/Tags/TagHandlerTests.cs.meta +3 -0
  1365. package/Tests/Runtime/Tags.meta +8 -0
  1366. package/Tests/Runtime/TestUtils/CommonTestBase.cs +301 -0
  1367. package/Tests/Runtime/TestUtils/CommonTestBase.cs.meta +11 -0
  1368. package/Tests/Runtime/TestUtils/GCAssert.cs +55 -0
  1369. package/Tests/Runtime/TestUtils/GCAssert.cs.meta +11 -0
  1370. package/Tests/Runtime/TestUtils/SpatialAssert.cs +33 -0
  1371. package/Tests/Runtime/TestUtils/SpatialAssert.cs.meta +11 -0
  1372. package/Tests/Runtime/TestUtils/SpatialDiagnostics.cs +195 -0
  1373. package/Tests/Runtime/TestUtils/SpatialDiagnostics.cs.meta +11 -0
  1374. package/Tests/Runtime/TestUtils.meta +8 -0
  1375. package/Tests/Runtime/Utils/AnimationEventEqualityComparerTests.cs +144 -0
  1376. package/Tests/Runtime/Utils/AnimationEventEqualityComparerTests.cs.meta +11 -0
  1377. package/Tests/Runtime/Utils/Ascii85Tests.cs +56 -0
  1378. package/Tests/Runtime/Utils/Ascii85Tests.cs.meta +11 -0
  1379. package/Tests/Runtime/Utils/BuffersTests.cs +1148 -741
  1380. package/Tests/Runtime/Utils/BuffersTests.cs.meta +2 -2
  1381. package/Tests/Runtime/Utils/BuffersWaitInstructionTests.cs +31 -0
  1382. package/Tests/Runtime/Utils/BuffersWaitInstructionTests.cs.meta +11 -0
  1383. package/Tests/Runtime/Utils/CenterPointOffsetTests.cs +67 -0
  1384. package/Tests/Runtime/Utils/CenterPointOffsetTests.cs.meta +11 -0
  1385. package/Tests/Runtime/Utils/ChildSpawnerTests.cs +490 -0
  1386. package/Tests/Runtime/Utils/ChildSpawnerTests.cs.meta +11 -0
  1387. package/Tests/Runtime/Utils/CircleLineRendererTests.cs +80 -0
  1388. package/Tests/Runtime/Utils/CircleLineRendererTests.cs.meta +11 -0
  1389. package/Tests/Runtime/Utils/CollisionProxyTests.cs +442 -0
  1390. package/Tests/Runtime/Utils/CollisionProxyTests.cs.meta +11 -0
  1391. package/Tests/Runtime/Utils/CoroutineHandlerTests.cs +353 -0
  1392. package/Tests/Runtime/Utils/CoroutineHandlerTests.cs.meta +11 -0
  1393. package/Tests/Runtime/Utils/DeferredDisposalResultTests.cs +44 -0
  1394. package/Tests/Runtime/Utils/DeferredDisposalResultTests.cs.meta +11 -0
  1395. package/Tests/Runtime/Utils/LZMAComprehensiveTests.cs +249 -0
  1396. package/Tests/Runtime/Utils/LZMAComprehensiveTests.cs.meta +11 -0
  1397. package/Tests/Runtime/Utils/LZMATests.cs +31 -0
  1398. package/Tests/Runtime/Utils/LZMATests.cs.meta +11 -0
  1399. package/Tests/Runtime/Utils/MatchColliderToSpriteAdditionalTests.cs +86 -0
  1400. package/Tests/Runtime/Utils/MatchColliderToSpriteAdditionalTests.cs.meta +11 -0
  1401. package/Tests/Runtime/Utils/MatchColliderToSpriteTests.cs +503 -0
  1402. package/Tests/Runtime/Utils/MatchColliderToSpriteTests.cs.meta +11 -0
  1403. package/Tests/Runtime/Utils/MatchTransformEdgeTests.cs +34 -0
  1404. package/Tests/Runtime/Utils/MatchTransformEdgeTests.cs.meta +11 -0
  1405. package/Tests/Runtime/Utils/MatchTransformTests.cs +495 -0
  1406. package/Tests/Runtime/Utils/MatchTransformTests.cs.meta +11 -0
  1407. package/Tests/Runtime/Utils/OscillatorTests.cs +540 -0
  1408. package/Tests/Runtime/Utils/OscillatorTests.cs.meta +11 -0
  1409. package/Tests/Runtime/Utils/PolygonCollider2DOptimizerTests.cs +52 -0
  1410. package/Tests/Runtime/Utils/PolygonCollider2DOptimizerTests.cs.meta +11 -0
  1411. package/Tests/Runtime/Utils/RuntimeSingletonTests.cs +766 -0
  1412. package/Tests/Runtime/Utils/RuntimeSingletonTests.cs.meta +11 -0
  1413. package/Tests/Runtime/Utils/SerializedStringComparerEdgeTests.cs +47 -0
  1414. package/Tests/Runtime/Utils/SerializedStringComparerEdgeTests.cs.meta +11 -0
  1415. package/Tests/Runtime/Utils/SerializedStringComparerTests.cs +361 -0
  1416. package/Tests/Runtime/Utils/SerializedStringComparerTests.cs.meta +11 -0
  1417. package/Tests/Runtime/Utils/SpriteRendererMetadataTests.cs +383 -398
  1418. package/Tests/Runtime/Utils/SpriteRendererMetadataTests.cs.meta +2 -2
  1419. package/Tests/Runtime/Utils/SpriteRendererSyncTests.cs +134 -0
  1420. package/Tests/Runtime/Utils/SpriteRendererSyncTests.cs.meta +11 -0
  1421. package/Tests/Runtime/Utils/StartTrackerTests.cs +24 -0
  1422. package/Tests/Runtime/Utils/StartTrackerTests.cs.meta +11 -0
  1423. package/Tests/Runtime/Utils/TextureScaleEdgeTests.cs +114 -0
  1424. package/Tests/Runtime/Utils/TextureScaleEdgeTests.cs.meta +11 -0
  1425. package/Tests/Runtime/Utils/TextureScaleTests.cs +298 -0
  1426. package/Tests/Runtime/Utils/TextureScaleTests.cs.meta +3 -0
  1427. package/Tests/Runtime/Utils/TypeNameSorterAdditionalTests.cs +36 -0
  1428. package/Tests/Runtime/Utils/TypeNameSorterAdditionalTests.cs.meta +11 -0
  1429. package/Tests/Runtime/Utils/TypeNameSorterTests.cs +34 -0
  1430. package/Tests/Runtime/Utils/TypeNameSorterTests.cs.meta +11 -0
  1431. package/Tests/Runtime/Utils/UnityObjectNameComparerEdgeTests.cs +63 -0
  1432. package/Tests/Runtime/Utils/UnityObjectNameComparerEdgeTests.cs.meta +11 -0
  1433. package/Tests/Runtime/Utils/UnityObjectNameComparerTests.cs +59 -0
  1434. package/Tests/Runtime/Utils/UnityObjectNameComparerTests.cs.meta +11 -0
  1435. package/Tests/Runtime/Utils.meta +2 -2
  1436. package/Tests/Runtime/Visuals/AnimatedSpriteLayerTests.cs +266 -0
  1437. package/Tests/Runtime/Visuals/AnimatedSpriteLayerTests.cs.meta +11 -0
  1438. package/Tests/Runtime/Visuals/EnhancedImageTests.cs +153 -0
  1439. package/Tests/Runtime/Visuals/EnhancedImageTests.cs.meta +11 -0
  1440. package/Tests/Runtime/Visuals/LayeredImageTests.cs +422 -0
  1441. package/Tests/Runtime/Visuals/LayeredImageTests.cs.meta +11 -0
  1442. package/Tests/Runtime/Visuals/VisualsTestHelpers.cs +125 -0
  1443. package/Tests/Runtime/Visuals/VisualsTestHelpers.cs.meta +11 -0
  1444. package/Tests/Runtime/Visuals.meta +3 -0
  1445. package/Tests/Runtime/WallstopStudios.UnityHelpers.Tests.Runtime.asmdef +24 -23
  1446. package/Tests/Runtime/WallstopStudios.UnityHelpers.Tests.Runtime.asmdef.meta +7 -7
  1447. package/Tests/Runtime.meta +8 -8
  1448. package/Tests.meta +8 -8
  1449. package/URP/VolumeProfiles/Post Processing Bloom Profile(URP).asset +63 -63
  1450. package/URP/VolumeProfiles/Post Processing Bloom Profile(URP).asset.meta +8 -8
  1451. package/URP/VolumeProfiles.meta +8 -8
  1452. package/URP.meta +8 -8
  1453. package/node_modules.meta +8 -0
  1454. package/package-lock.json.meta +7 -0
  1455. package/package.json +99 -38
  1456. package/package.json.meta +7 -7
  1457. package/scripts/check-eol.ps1 +51 -0
  1458. package/scripts/check-eol.ps1.meta +7 -0
  1459. package/scripts/clean-nul.ps1 +29 -0
  1460. package/scripts/clean-nul.ps1.meta +7 -0
  1461. package/scripts/lint-doc-links.ps1 +80 -0
  1462. package/scripts/lint-doc-links.ps1.meta +7 -0
  1463. package/scripts/lint-tests.ps1 +156 -0
  1464. package/scripts/lint-tests.ps1.meta +7 -0
  1465. package/scripts/normalize-eol.ps1 +68 -0
  1466. package/scripts/normalize-eol.ps1.meta +7 -0
  1467. package/scripts.meta +8 -0
  1468. package/Editor/Sprites/ProjectAnimationSettings.cs +0 -50
  1469. package/Editor/Sprites/ProjectAnimationSettings.cs.meta +0 -3
  1470. package/Editor/Sprites/TextureSettingsApplier.cs +0 -178
  1471. package/Editor/Sprites/TextureSettingsApplier.cs.meta +0 -3
  1472. package/Runtime/Core/Attributes/ParentComponent.cs +0 -189
  1473. package/Runtime/Core/DataStructure/KDTree.cs +0 -434
  1474. package/Runtime/Core/DataStructure/QuadTree.cs +0 -431
  1475. package/Runtime/Core/DataStructure/RTree.cs +0 -356
  1476. package/Runtime/Core/Extension/HashSetExtensions.cs +0 -12
  1477. package/Runtime/Core/Extension/HashSetExtensions.cs.meta +0 -11
  1478. package/Runtime/Core/Math/Line.cs +0 -55
  1479. package/Runtime/Core/Math/Line.cs.meta +0 -11
  1480. package/Runtime/Core/Math/XXHash.cs +0 -310
  1481. package/Runtime/Core/Math/XXHash.cs.meta +0 -11
  1482. package/Tests/Runtime/Components/RelationalComponentsTesterSimple.cs +0 -40
  1483. package/Tests/Runtime/Components.meta +0 -3
  1484. package/Tests/Runtime/DataStructures/BalancedKDTreeTests.cs +0 -14
  1485. package/Tests/Runtime/DataStructures/QuadTreeTests.cs +0 -14
  1486. package/Tests/Runtime/DataStructures/QuadTreeTests.cs.meta +0 -11
  1487. package/Tests/Runtime/DataStructures/SpatialTreeTests.cs +0 -130
  1488. package/Tests/Runtime/DataStructures/SpatialTreeTests.cs.meta +0 -11
  1489. package/Tests/Runtime/DataStructures/UnbalancedKDTreeTests.cs +0 -14
  1490. package/Tests/Runtime/Helper/FormattingHelperTests.cs +0 -129
  1491. package/Tests/Runtime/Helper/FormattingHelperTests.cs.meta +0 -3
  1492. package/Tests/Runtime/Performance/KDTreePerformanceTests.cs +0 -14
  1493. package/Tests/Runtime/Performance/KDTreePerformanceTests.cs.meta +0 -11
  1494. package/Tests/Runtime/Performance/QuadTreePerformanceTests.cs +0 -14
  1495. package/Tests/Runtime/Performance/QuadTreePerformanceTests.cs.meta +0 -11
  1496. package/Tests/Runtime/Performance/SpatialTreePerformanceTest.cs +0 -158
  1497. package/Tests/Runtime/Performance/SpatialTreePerformanceTest.cs.meta +0 -11
  1498. package/Tests/Runtime/Performance/UnbalancedKDTreeTests.cs +0 -14
  1499. package/Tests/Runtime/Performance/UnbalancedKDTreeTests.cs.meta +0 -11
  1500. package/Third Party Notices.md +0 -1
@@ -1,1522 +1,1670 @@
1
- // ReSharper disable HeapView.CanAvoidClosure
2
- namespace WallstopStudios.UnityHelpers.Editor.Sprites
3
- {
4
- #if UNITY_EDITOR
5
- using System;
6
- using System.Collections.Generic;
7
- using System.IO;
8
- using System.Linq;
9
- using Core.Extension;
10
- using Core.Helper;
11
- using UnityEditor;
12
- using UnityEditor.UIElements;
13
- using UnityEngine;
14
- using UnityEngine.UIElements;
15
- using WallstopStudios.UnityHelpers.Visuals;
16
- using WallstopStudios.UnityHelpers.Visuals.UIToolkit;
17
- using Object = UnityEngine.Object;
18
-
19
- public sealed class AnimationViewerWindow : EditorWindow
20
- {
21
- private const string PackageId = "com.wallstop-studios.unity-helpers";
22
- private const float DragThresholdSqrMagnitude = 10f * 10f;
23
- private const int InvalidPointerId = -1;
24
-
25
- private sealed class EditorLayerData
26
- {
27
- public AnimationClip SourceClip { get; }
28
- public List<Sprite> Sprites { get; }
29
- public string ClipName => SourceClip != null ? SourceClip.name : "Unnamed Layer";
30
- public float OriginalClipFps { get; }
31
- public string BindingPath { get; }
32
-
33
- public EditorLayerData(AnimationClip clip)
34
- {
35
- SourceClip = clip;
36
- Sprites = clip.GetSpritesFromClip()?.ToList();
37
- OriginalClipFps =
38
- clip.frameRate > 0 ? clip.frameRate : AnimatedSpriteLayer.FrameRate;
39
-
40
- BindingPath = string.Empty;
41
- if (SourceClip != null)
42
- {
43
- foreach (
44
- EditorCurveBinding binding in AnimationUtility.GetObjectReferenceCurveBindings(
45
- SourceClip
46
- )
47
- )
48
- {
49
- if (
50
- binding.type == typeof(SpriteRenderer)
51
- && binding.propertyName == "m_Sprite"
52
- )
53
- {
54
- BindingPath = binding.path;
55
- break;
56
- }
57
- }
58
- }
59
- }
60
- }
61
-
62
- [MenuItem("Tools/Wallstop Studios/Unity Helpers/Sprite Animation Editor")]
63
- public static void ShowWindow()
64
- {
65
- AnimationViewerWindow wnd = GetWindow<AnimationViewerWindow>();
66
- wnd.titleContent = new GUIContent("2D Animation Viewer");
67
- wnd.minSize = new Vector2(750, 500);
68
- }
69
-
70
- private VisualTreeAsset _visualTree;
71
- private StyleSheet _styleSheet;
72
-
73
- private ObjectField _addAnimationClipField;
74
- private Button _browseAndAddButton;
75
- private FloatField _fpsField;
76
- private Button _applyFpsButton;
77
- private Button _saveClipButton;
78
- private VisualElement _loadedClipsContainer;
79
- private VisualElement _previewPanelHost;
80
- private LayeredImage _animationPreview;
81
- private VisualElement _framesContainer;
82
- private Label _fpsDebugLabel;
83
- private Label _framesPanelTitle;
84
- private MultiFileSelectorElement _fileSelector;
85
-
86
- private readonly List<EditorLayerData> _loadedEditorLayers = new();
87
-
88
- private EditorLayerData _activeEditorLayer;
89
- private float _currentPreviewFps = AnimatedSpriteLayer.FrameRate;
90
-
91
- private VisualElement _draggedFrameElement;
92
- private int _draggedFrameOriginalDataIndex;
93
- private VisualElement _frameDropPlaceholder;
94
-
95
- private VisualElement _draggedLoadedClipElement;
96
- private int _draggedLoadedClipOriginalIndex;
97
- private VisualElement _loadedClipDropPlaceholder;
98
-
99
- private bool _isClipDragPending;
100
- private Vector3 _clipDragStartPosition;
101
- private VisualElement _clipDragPendingElement;
102
- private int _clipDragPendingOriginalIndex;
103
-
104
- public void CreateGUI()
105
- {
106
- VisualElement root = rootVisualElement;
107
-
108
- TryLoadStyleSheets();
109
-
110
- if (_visualTree == null)
111
- {
112
- root.Add(new Label("Error: AnimationViewer.uxml not found."));
113
- return;
114
- }
115
- if (_styleSheet != null)
116
- {
117
- root.styleSheets.Add(_styleSheet);
118
- }
119
-
120
- _visualTree.CloneTree(root);
121
-
122
- _addAnimationClipField = root.Q<ObjectField>("addAnimationClipField");
123
- _browseAndAddButton = root.Q<Button>("browseAndAddButton");
124
- _fpsField = root.Q<FloatField>("fpsField");
125
- _applyFpsButton = root.Q<Button>("applyFpsButton");
126
- _saveClipButton = root.Q<Button>("saveClipButton");
127
- _loadedClipsContainer = root.Q<VisualElement>("loadedClipsContainer");
128
- _previewPanelHost = root.Q<VisualElement>("preview-panel");
129
- _framesContainer = root.Q<VisualElement>("framesContainer");
130
- _fpsDebugLabel = root.Q<Label>("fpsDebugLabel");
131
- _framesPanelTitle = root.Q<Label>("framesPanelTitle");
132
-
133
- _previewPanelHost.AddToClassList("animation-preview-container");
134
-
135
- _fpsField.value = _currentPreviewFps;
136
- _saveClipButton.SetEnabled(false);
137
-
138
- _addAnimationClipField.RegisterValueChangedCallback(OnAddAnimationClipFieldChanged);
139
- _browseAndAddButton.text = "Add Selected Clips from Project";
140
- _browseAndAddButton.clicked -= OnBrowseAndAddClicked;
141
- if (_browseAndAddButton != null)
142
- {
143
- _browseAndAddButton.text = "Browse Clips (Multi)...";
144
- _browseAndAddButton.clicked -= OnAddSelectedClipsFromProjectClicked;
145
- _browseAndAddButton.clicked += ToggleMultiFileSelector;
146
- }
147
- else
148
- {
149
- this.LogError(
150
- $"'browseAndAddButton' not found in UXML. Multi-file browser cannot be triggered."
151
- );
152
- }
153
- _applyFpsButton.clicked += OnApplyFpsToPreviewClicked;
154
- _saveClipButton.clicked += OnSaveClipClicked;
155
-
156
- _frameDropPlaceholder = new VisualElement();
157
- _frameDropPlaceholder.AddToClassList("drop-placeholder");
158
- _frameDropPlaceholder.style.height = 5;
159
- _frameDropPlaceholder.style.visibility = Visibility.Hidden;
160
-
161
- _framesContainer.RegisterCallback<DragUpdatedEvent>(OnFramesContainerDragUpdated);
162
- _framesContainer.RegisterCallback<DragPerformEvent>(OnFramesContainerDragPerform);
163
- _framesContainer.RegisterCallback<DragLeaveEvent>(OnFramesContainerDragLeave);
164
-
165
- _loadedClipDropPlaceholder = new VisualElement();
166
- _loadedClipDropPlaceholder.AddToClassList("drop-placeholder");
167
- _loadedClipDropPlaceholder.style.height = 5;
168
- _loadedClipDropPlaceholder.style.visibility = Visibility.Hidden;
169
-
170
- _loadedClipsContainer.RegisterCallback<DragUpdatedEvent>(
171
- OnLoadedClipsContainerDragUpdated
172
- );
173
- _loadedClipsContainer.RegisterCallback<DragPerformEvent>(
174
- OnLoadedClipsContainerDragPerform
175
- );
176
- _loadedClipsContainer.RegisterCallback<DragLeaveEvent>(OnLoadedClipsContainerDragLeave);
177
-
178
- UpdateFramesPanelTitle();
179
- RebuildLoadedClipsUI();
180
- RecreatePreviewImage();
181
- }
182
-
183
- private void Update()
184
- {
185
- _animationPreview?.Update();
186
- }
187
-
188
- private void TryLoadStyleSheets()
189
- {
190
- string packageRoot = DirectoryHelper.FindPackageRootPath(
191
- DirectoryHelper.GetCallerScriptDirectory()
192
- );
193
- if (!string.IsNullOrWhiteSpace(packageRoot))
194
- {
195
- if (
196
- packageRoot.StartsWith("Packages", StringComparison.OrdinalIgnoreCase)
197
- && !packageRoot.Contains(PackageId, StringComparison.OrdinalIgnoreCase)
198
- )
199
- {
200
- int helpersIndex = packageRoot.LastIndexOf(
201
- "UnityHelpers",
202
- StringComparison.Ordinal
203
- );
204
- if (0 <= helpersIndex)
205
- {
206
- packageRoot = packageRoot[..helpersIndex];
207
- packageRoot += PackageId;
208
- }
209
- }
210
-
211
- char pathSeparator = Path.DirectorySeparatorChar;
212
- string styleSheetPath =
213
- $"{packageRoot}{pathSeparator}Editor{pathSeparator}Styles{pathSeparator}AnimationViewer.uss";
214
- string unityRelativeStyleSheetPath = DirectoryHelper.AbsoluteToUnityRelativePath(
215
- styleSheetPath
216
- );
217
- unityRelativeStyleSheetPath = unityRelativeStyleSheetPath.SanitizePath();
218
-
219
- const string packageCache = "PackageCache/";
220
- int packageCacheIndex;
221
- if (!string.IsNullOrWhiteSpace(unityRelativeStyleSheetPath))
222
- {
223
- _styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>(
224
- unityRelativeStyleSheetPath
225
- );
226
- }
227
-
228
- if (_styleSheet == null && !string.IsNullOrWhiteSpace(unityRelativeStyleSheetPath))
229
- {
230
- packageCacheIndex = unityRelativeStyleSheetPath.IndexOf(
231
- packageCache,
232
- StringComparison.OrdinalIgnoreCase
233
- );
234
- if (0 <= packageCacheIndex)
235
- {
236
- unityRelativeStyleSheetPath = unityRelativeStyleSheetPath[
237
- (packageCacheIndex + packageCache.Length)..
238
- ];
239
- int forwardIndex = unityRelativeStyleSheetPath.IndexOf(
240
- "/",
241
- StringComparison.Ordinal
242
- );
243
- if (0 <= forwardIndex)
244
- {
245
- unityRelativeStyleSheetPath = unityRelativeStyleSheetPath.Substring(
246
- forwardIndex
247
- );
248
- unityRelativeStyleSheetPath =
249
- "Packages/" + PackageId + "/" + unityRelativeStyleSheetPath;
250
- }
251
- else
252
- {
253
- unityRelativeStyleSheetPath = "Packages/" + unityRelativeStyleSheetPath;
254
- }
255
- }
256
-
257
- if (!string.IsNullOrWhiteSpace(unityRelativeStyleSheetPath))
258
- {
259
- _styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>(
260
- unityRelativeStyleSheetPath
261
- );
262
- if (_styleSheet == null)
263
- {
264
- this.LogError(
265
- $"Failed to load Animation Viewer style sheet (package root: '{packageRoot}'), relative path '{unityRelativeStyleSheetPath}'."
266
- );
267
- }
268
- }
269
- else
270
- {
271
- this.LogError(
272
- $"Failed to convert absolute path '{styleSheetPath}' to Unity relative path."
273
- );
274
- }
275
- }
276
-
277
- string visualTreePath =
278
- $"{packageRoot}{pathSeparator}Editor{pathSeparator}Styles{pathSeparator}AnimationViewer.uxml";
279
- string unityRelativeVisualTreePath = DirectoryHelper.AbsoluteToUnityRelativePath(
280
- visualTreePath
281
- );
282
-
283
- _visualTree = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
284
- unityRelativeVisualTreePath
285
- );
286
- if (_visualTree == null)
287
- {
288
- packageCacheIndex = unityRelativeVisualTreePath.IndexOf(
289
- packageCache,
290
- StringComparison.OrdinalIgnoreCase
291
- );
292
- if (0 <= packageCacheIndex)
293
- {
294
- unityRelativeVisualTreePath = unityRelativeVisualTreePath[
295
- (packageCacheIndex + packageCache.Length)..
296
- ];
297
- int forwardIndex = unityRelativeVisualTreePath.IndexOf(
298
- "/",
299
- StringComparison.Ordinal
300
- );
301
- if (0 <= forwardIndex)
302
- {
303
- unityRelativeVisualTreePath = unityRelativeVisualTreePath.Substring(
304
- forwardIndex
305
- );
306
- unityRelativeVisualTreePath =
307
- "Packages/" + PackageId + "/" + unityRelativeVisualTreePath;
308
- }
309
- else
310
- {
311
- unityRelativeVisualTreePath = "Packages/" + unityRelativeVisualTreePath;
312
- }
313
- }
314
-
315
- if (!string.IsNullOrWhiteSpace(unityRelativeVisualTreePath))
316
- {
317
- _visualTree = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
318
- unityRelativeVisualTreePath
319
- );
320
- }
321
- }
322
- }
323
- else
324
- {
325
- this.LogError(
326
- $"Failed to find Animation Viewer style sheet (package root: '{packageRoot}')."
327
- );
328
- }
329
- }
330
-
331
- private void ToggleMultiFileSelector()
332
- {
333
- VisualElement root = rootVisualElement;
334
- if (_fileSelector == null)
335
- {
336
- _fileSelector = new MultiFileSelectorElement(
337
- ProjectAnimationSettings.Instance.lastAnimationPath,
338
- new[] { ".anim" }
339
- );
340
- _fileSelector.OnFilesSelected += HandleFilesSelectedFromCustomBrowser;
341
- _fileSelector.OnCancelled += HideMultiFileSelector;
342
- root.Add(_fileSelector);
343
- if (root.childCount > 1)
344
- {
345
- _fileSelector.PlaceInFront(root.Children().FirstOrDefault());
346
- }
347
- }
348
- else if (_fileSelector.parent == null)
349
- {
350
- _fileSelector.ResetAndShow(ProjectAnimationSettings.Instance.lastAnimationPath);
351
- root.Add(_fileSelector);
352
- if (root.childCount > 1)
353
- {
354
- _fileSelector.PlaceInFront(root.Children().FirstOrDefault());
355
- }
356
- }
357
- else
358
- {
359
- HideMultiFileSelector();
360
- }
361
- }
362
-
363
- private void HideMultiFileSelector()
364
- {
365
- if (_fileSelector is { parent: not null })
366
- {
367
- _fileSelector.parent.Remove(_fileSelector);
368
- }
369
- }
370
-
371
- private void HandleFilesSelectedFromCustomBrowser(List<string> selectedFullPaths)
372
- {
373
- HideMultiFileSelector();
374
-
375
- if (selectedFullPaths == null || selectedFullPaths.Count == 0)
376
- {
377
- return;
378
- }
379
-
380
- int clipsAddedCount = 0;
381
- string lastValidDirectory = null;
382
-
383
- foreach (string fullPath in selectedFullPaths)
384
- {
385
- string assetPath = fullPath.SanitizePath();
386
- if (!assetPath.StartsWith("Assets", StringComparison.OrdinalIgnoreCase))
387
- {
388
- if (
389
- assetPath.StartsWith(
390
- Application.dataPath,
391
- StringComparison.OrdinalIgnoreCase
392
- )
393
- )
394
- {
395
- assetPath = "Assets" + assetPath.Substring(Application.dataPath.Length);
396
- }
397
- else
398
- {
399
- this.LogWarn(
400
- $"Selected file '{fullPath}' is outside the project's Assets folder or path is not project-relative. Skipping."
401
- );
402
- continue;
403
- }
404
- }
405
-
406
- AnimationClip clip = AssetDatabase.LoadAssetAtPath<AnimationClip>(assetPath);
407
- if (clip != null)
408
- {
409
- if (_loadedEditorLayers.All(layer => layer.SourceClip != clip))
410
- {
411
- AddEditorLayer(clip);
412
- clipsAddedCount++;
413
- lastValidDirectory = Path.GetDirectoryName(assetPath);
414
- }
415
- else
416
- {
417
- this.LogWarn($"Clip '{clip.name}' already loaded. Skipping.");
418
- }
419
- }
420
- else
421
- {
422
- this.LogWarn($"Could not load AnimationClip from: {assetPath}");
423
- }
424
- }
425
-
426
- if (clipsAddedCount > 0)
427
- {
428
- this.Log($"Added {clipsAddedCount} clip(s).");
429
- if (!string.IsNullOrWhiteSpace(lastValidDirectory))
430
- {
431
- ProjectAnimationSettings.Instance.lastAnimationPath = lastValidDirectory;
432
- ProjectAnimationSettings.Instance.Save();
433
- }
434
- }
435
- }
436
-
437
- private void OnAddAnimationClipFieldChanged(ChangeEvent<Object> evt)
438
- {
439
- AnimationClip clip = evt.newValue as AnimationClip;
440
- if (clip != null)
441
- {
442
- AddEditorLayer(clip);
443
- _addAnimationClipField.SetValueWithoutNotify(null);
444
- }
445
- }
446
-
447
- private void OnAddSelectedClipsFromProjectClicked()
448
- {
449
- Object[] selectedObjects = Selection.GetFiltered(
450
- typeof(AnimationClip),
451
- SelectionMode.Assets
452
- );
453
-
454
- if (selectedObjects == null || selectedObjects.Length == 0)
455
- {
456
- EditorUtility.DisplayDialog(
457
- "No Clips Selected",
458
- "Please select one or more AnimationClip assets in the Project window first.",
459
- "OK"
460
- );
461
- return;
462
- }
463
-
464
- int clipsAddedCount = 0;
465
- foreach (Object obj in selectedObjects)
466
- {
467
- if (obj is AnimationClip clip)
468
- {
469
- bool alreadyExists = _loadedEditorLayers.Any(layer => layer.SourceClip == clip);
470
- if (!alreadyExists)
471
- {
472
- AddEditorLayer(clip);
473
- clipsAddedCount++;
474
- }
475
- else
476
- {
477
- this.LogWarn($"Clip '{clip.name}' is already loaded. Skipping.");
478
- }
479
- }
480
- }
481
-
482
- if (clipsAddedCount > 0)
483
- {
484
- this.Log($"Added {clipsAddedCount} new AnimationClip(s) to the viewer.");
485
- }
486
- else if (selectedObjects.Length > 0)
487
- {
488
- this.Log($"All selected AnimationClips were already loaded.");
489
- }
490
- }
491
-
492
- private void OnBrowseAndAddClicked()
493
- {
494
- string path = EditorUtility.OpenFilePanelWithFilters(
495
- "Select Animation Clip to Add",
496
- ProjectAnimationSettings.Instance.lastAnimationPath,
497
- new[] { "Animation Clip", "anim" }
498
- );
499
-
500
- if (!string.IsNullOrWhiteSpace(path))
501
- {
502
- if (path.StartsWith(Application.dataPath))
503
- {
504
- path = "Assets" + path.Substring(Application.dataPath.Length);
505
- }
506
-
507
- ProjectAnimationSettings.Instance.lastAnimationPath = Path.GetDirectoryName(path);
508
- ProjectAnimationSettings.Instance.Save();
509
-
510
- AnimationClip clip = AssetDatabase.LoadAssetAtPath<AnimationClip>(path);
511
- if (clip != null)
512
- {
513
- AddEditorLayer(clip);
514
- }
515
- }
516
- }
517
-
518
- private void AddEditorLayer(AnimationClip clip)
519
- {
520
- if (clip == null || _loadedEditorLayers.Any(layer => layer.SourceClip == clip))
521
- {
522
- this.LogWarn($"Clip '{clip?.name}' is null or already loaded.");
523
- return;
524
- }
525
-
526
- EditorLayerData newEditorLayer = new(clip);
527
- _loadedEditorLayers.Add(newEditorLayer);
528
-
529
- if (_activeEditorLayer == null && newEditorLayer.Sprites.Count > 0)
530
- {
531
- SetActiveEditorLayer(newEditorLayer);
532
- }
533
- else if (_activeEditorLayer == null)
534
- {
535
- SetActiveEditorLayer(newEditorLayer);
536
- }
537
-
538
- RebuildLoadedClipsUI();
539
- RecreatePreviewImage();
540
- }
541
-
542
- private void RemoveEditorLayer(EditorLayerData layerToRemove)
543
- {
544
- if (layerToRemove == null)
545
- {
546
- return;
547
- }
548
-
549
- _loadedEditorLayers.Remove(layerToRemove);
550
-
551
- if (_activeEditorLayer == layerToRemove)
552
- {
553
- SetActiveEditorLayer(_loadedEditorLayers.FirstOrDefault());
554
- }
555
-
556
- RebuildLoadedClipsUI();
557
- RecreatePreviewImage();
558
- }
559
-
560
- private void SetActiveEditorLayer(EditorLayerData layer)
561
- {
562
- _activeEditorLayer = layer;
563
- _framesContainer.Clear();
564
- _fpsDebugLabel.text = "Detected FPS Info (Active Clip):";
565
-
566
- if (_activeEditorLayer != null)
567
- {
568
- UpdateFpsDebugLabelForActiveLayer();
569
- _saveClipButton.SetEnabled(_activeEditorLayer.SourceClip != null);
570
- }
571
- else
572
- {
573
- _saveClipButton.SetEnabled(false);
574
- }
575
-
576
- RebuildFramesListUI();
577
- RebuildLoadedClipsUI();
578
- UpdateFramesPanelTitle();
579
- }
580
-
581
- private void UpdateFramesPanelTitle()
582
- {
583
- _framesPanelTitle.text =
584
- _activeEditorLayer != null
585
- ? $"Frames (Editing: {_activeEditorLayer.ClipName})"
586
- : "Frames (No Active Clip Selected)";
587
- }
588
-
589
- private void RebuildLoadedClipsUI()
590
- {
591
- _loadedClipsContainer.Clear();
592
- if (_loadedClipDropPlaceholder.parent == _loadedClipsContainer)
593
- {
594
- _loadedClipsContainer.Remove(_loadedClipDropPlaceholder);
595
- }
596
-
597
- for (int i = 0; i < _loadedEditorLayers.Count; i++)
598
- {
599
- EditorLayerData editorLayer = _loadedEditorLayers[i];
600
-
601
- VisualElement itemElement = new();
602
- itemElement.AddToClassList("loaded-clip-item");
603
- if (editorLayer == _activeEditorLayer)
604
- {
605
- itemElement.AddToClassList("loaded-clip-item--active");
606
- }
607
- itemElement.userData = i;
608
-
609
- Label label = new(editorLayer.ClipName);
610
- itemElement.Add(label);
611
-
612
- Button removeButton = new(() => RemoveEditorLayer(editorLayer)) { text = "X" };
613
- itemElement.Add(removeButton);
614
-
615
- itemElement.RegisterCallback<PointerDownEvent>(evt =>
616
- {
617
- if (evt.button == 0 && _draggedLoadedClipElement == null)
618
- {
619
- SetActiveEditorLayer(editorLayer);
620
- }
621
- });
622
-
623
- int currentIndex = i;
624
- itemElement.RegisterCallback<PointerDownEvent>(evt =>
625
- OnLoadedClipItemPointerDownSetup(evt, itemElement, currentIndex)
626
- );
627
- itemElement.RegisterCallback<PointerMoveEvent>(OnLoadedClipItemPointerMove);
628
- itemElement.RegisterCallback<PointerUpEvent>(evt =>
629
- OnLoadedClipItemPointerUpForClick(evt, itemElement, currentIndex)
630
- );
631
-
632
- _loadedClipsContainer.Add(itemElement);
633
- }
634
- }
635
-
636
- private void OnLoadedClipItemPointerDownSetup(
637
- PointerDownEvent evt,
638
- VisualElement clipElement,
639
- int originalListIndex
640
- )
641
- {
642
- if (evt.button != 0 || _draggedLoadedClipElement != null || _isClipDragPending)
643
- {
644
- return;
645
- }
646
-
647
- _isClipDragPending = true;
648
- _clipDragPendingElement = clipElement;
649
- _clipDragPendingOriginalIndex = originalListIndex;
650
- _clipDragStartPosition = evt.position;
651
-
652
- clipElement.CapturePointer(evt.pointerId);
653
-
654
- evt.StopPropagation();
655
- }
656
-
657
- private void OnLoadedClipItemPointerMove(PointerMoveEvent evt)
658
- {
659
- if (!_isClipDragPending)
660
- {
661
- return;
662
- }
663
-
664
- float diffSqrMagnitude = (evt.position - _clipDragStartPosition).sqrMagnitude;
665
-
666
- if (diffSqrMagnitude >= DragThresholdSqrMagnitude)
667
- {
668
- _draggedLoadedClipElement = _clipDragPendingElement;
669
- _draggedLoadedClipOriginalIndex = _clipDragPendingOriginalIndex;
670
-
671
- _draggedLoadedClipElement.AddToClassList("frame-item-dragged");
672
-
673
- DragAndDrop.PrepareStartDrag();
674
- DragAndDrop.SetGenericData(
675
- "DraggedLoadedClipIndex",
676
- _draggedLoadedClipOriginalIndex
677
- );
678
- Object dragContextObject =
679
- _loadedEditorLayers[_draggedLoadedClipOriginalIndex]?.SourceClip
680
- ?? (Object)CreateInstance<ScriptableObject>();
681
- DragAndDrop.objectReferences = new[] { dragContextObject };
682
- DragAndDrop.StartDrag(
683
- _loadedEditorLayers[_draggedLoadedClipOriginalIndex].ClipName
684
- ?? "Dragging Layer"
685
- );
686
-
687
- _isClipDragPending = false;
688
- }
689
- }
690
-
691
- private void OnLoadedClipItemPointerUpForClick(
692
- PointerUpEvent evt,
693
- VisualElement clipElement,
694
- int listIndex
695
- )
696
- {
697
- if (evt.button != 0)
698
- {
699
- return;
700
- }
701
-
702
- if (clipElement.HasPointerCapture(evt.pointerId))
703
- {
704
- clipElement.ReleasePointer(evt.pointerId);
705
- }
706
- if (_isClipDragPending)
707
- {
708
- if (listIndex >= 0 && listIndex < _loadedEditorLayers.Count)
709
- {
710
- SetActiveEditorLayer(_loadedEditorLayers[listIndex]);
711
- }
712
- _isClipDragPending = false;
713
- _clipDragPendingElement = null;
714
- evt.StopPropagation();
715
- }
716
- else if (_draggedLoadedClipElement == _clipDragPendingElement)
717
- {
718
- if (DragAndDrop.GetGenericData("DraggedLoadedClipIndex") != null)
719
- {
720
- CleanupLoadedClipDragState(evt.pointerId);
721
- }
722
- evt.StopPropagation();
723
- }
724
-
725
- _isClipDragPending = false;
726
- _clipDragPendingElement = null;
727
- }
728
-
729
- private void OnDraggedLoadedClipItemPointerUp(PointerUpEvent evt)
730
- {
731
- if (_draggedLoadedClipElement == null || evt.currentTarget != _draggedLoadedClipElement)
732
- {
733
- return;
734
- }
735
-
736
- if (
737
- DragAndDrop.GetGenericData("DraggedLoadedClipIndex") != null
738
- || _draggedLoadedClipElement != null
739
- && _draggedLoadedClipElement.HasPointerCapture(evt.pointerId)
740
- )
741
- {
742
- CleanupLoadedClipDragState(evt.pointerId);
743
- }
744
-
745
- evt.StopPropagation();
746
- }
747
-
748
- private void OnLoadedClipsContainerDragUpdated(DragUpdatedEvent evt)
749
- {
750
- object draggedIndexData = DragAndDrop.GetGenericData("DraggedLoadedClipIndex");
751
- if (draggedIndexData != null && _draggedLoadedClipElement != null)
752
- {
753
- DragAndDrop.visualMode = DragAndDropVisualMode.Move;
754
- float mouseY = evt.localMousePosition.y;
755
- int newVisualIndex = -1;
756
-
757
- if (_loadedClipDropPlaceholder.parent == _loadedClipsContainer)
758
- {
759
- _loadedClipsContainer.Remove(_loadedClipDropPlaceholder);
760
- }
761
-
762
- for (int i = 0; i < _loadedClipsContainer.childCount; i++)
763
- {
764
- VisualElement child = _loadedClipsContainer[i];
765
- if (child == _draggedLoadedClipElement)
766
- {
767
- continue;
768
- }
769
-
770
- float childMidY = child.layout.yMin + child.layout.height / 2f;
771
- if (mouseY < childMidY)
772
- {
773
- newVisualIndex = i;
774
- break;
775
- }
776
- }
777
- if (
778
- newVisualIndex < 0
779
- && _loadedClipsContainer.childCount > 0
780
- && _draggedLoadedClipElement
781
- != _loadedClipsContainer.ElementAt(_loadedClipsContainer.childCount - 1)
782
- )
783
- {
784
- newVisualIndex = _loadedClipsContainer.childCount;
785
- }
786
-
787
- if (0 <= newVisualIndex)
788
- {
789
- _loadedClipsContainer.Insert(newVisualIndex, _loadedClipDropPlaceholder);
790
- _loadedClipDropPlaceholder.style.visibility = Visibility.Visible;
791
- }
792
- else if (_loadedClipsContainer.childCount == 0 && _draggedLoadedClipElement != null)
793
- {
794
- _loadedClipsContainer.Add(_loadedClipDropPlaceholder);
795
- _loadedClipDropPlaceholder.style.visibility = Visibility.Visible;
796
- }
797
- else
798
- {
799
- if (_loadedClipDropPlaceholder.parent == _loadedClipsContainer)
800
- {
801
- _loadedClipsContainer.Remove(_loadedClipDropPlaceholder);
802
- }
803
-
804
- _loadedClipDropPlaceholder.style.visibility = Visibility.Hidden;
805
- }
806
- }
807
- else
808
- {
809
- DragAndDrop.visualMode = DragAndDropVisualMode.Rejected;
810
- }
811
- evt.StopPropagation();
812
- }
813
-
814
- private void OnLoadedClipsContainerDragPerform(DragPerformEvent evt)
815
- {
816
- object draggedIndexData = DragAndDrop.GetGenericData("DraggedLoadedClipIndex");
817
- if (draggedIndexData != null && _draggedLoadedClipElement != null)
818
- {
819
- int originalListIndex = (int)draggedIndexData;
820
-
821
- if (originalListIndex < 0 || originalListIndex >= _loadedEditorLayers.Count)
822
- {
823
- this.LogError(
824
- $"DragPerform (LoadedClips): Stale or invalid dragged index. Aborting drop."
825
- );
826
- CleanupLoadedClipDragState(InvalidPointerId);
827
- evt.StopPropagation();
828
- return;
829
- }
830
-
831
- EditorLayerData movedLayer = _loadedEditorLayers[originalListIndex];
832
- _loadedEditorLayers.RemoveAt(originalListIndex);
833
-
834
- int placeholderVisualIndex = _loadedClipsContainer.IndexOf(
835
- _loadedClipDropPlaceholder
836
- );
837
- int targetListIndex;
838
-
839
- if (0 <= placeholderVisualIndex)
840
- {
841
- int itemsBeforePlaceholder = -1;
842
- for (int i = 0; i < placeholderVisualIndex; i++)
843
- {
844
- if (_loadedClipsContainer[i] != _loadedClipDropPlaceholder)
845
- {
846
- itemsBeforePlaceholder++;
847
- }
848
- else
849
- {
850
- break;
851
- }
852
- }
853
- targetListIndex = itemsBeforePlaceholder;
854
- }
855
- else
856
- {
857
- targetListIndex = _loadedEditorLayers.Count;
858
- }
859
- targetListIndex = Mathf.Clamp(targetListIndex, 0, _loadedEditorLayers.Count);
860
- _loadedEditorLayers.Insert(targetListIndex, movedLayer);
861
-
862
- DragAndDrop.AcceptDrag();
863
- CleanupLoadedClipDragState(InvalidPointerId);
864
-
865
- RebuildLoadedClipsUI();
866
- RecreatePreviewImage();
867
- }
868
- else
869
- {
870
- if (DragAndDrop.GetGenericData("DraggedLoadedClipIndex") != null)
871
- {
872
- CleanupLoadedClipDragState(InvalidPointerId);
873
- }
874
- }
875
- evt.StopPropagation();
876
- }
877
-
878
- private void OnLoadedClipsContainerDragLeave(DragLeaveEvent evt)
879
- {
880
- if (evt.target == _loadedClipsContainer)
881
- {
882
- if (_loadedClipDropPlaceholder.parent == _loadedClipsContainer)
883
- {
884
- _loadedClipsContainer.Remove(_loadedClipDropPlaceholder);
885
- }
886
-
887
- if (_loadedClipDropPlaceholder != null)
888
- {
889
- _loadedClipDropPlaceholder.style.visibility = Visibility.Hidden;
890
- }
891
- }
892
- }
893
-
894
- private void CleanupLoadedClipDragState(int pointerIdToRelease)
895
- {
896
- if (_draggedLoadedClipElement != null)
897
- {
898
- if (
899
- pointerIdToRelease != InvalidPointerId
900
- && _draggedLoadedClipElement.HasPointerCapture(pointerIdToRelease)
901
- )
902
- {
903
- _draggedLoadedClipElement.ReleasePointer(pointerIdToRelease);
904
- }
905
-
906
- _draggedLoadedClipElement.UnregisterCallback<PointerUpEvent>(
907
- OnDraggedLoadedClipItemPointerUp
908
- );
909
-
910
- _draggedLoadedClipElement.RemoveFromClassList("frame-item-dragged");
911
- _draggedLoadedClipElement = null;
912
- }
913
- _draggedLoadedClipOriginalIndex = -1;
914
-
915
- _isClipDragPending = false;
916
- if (_clipDragPendingElement != null)
917
- {
918
- if (
919
- pointerIdToRelease != InvalidPointerId
920
- && _clipDragPendingElement.HasPointerCapture(pointerIdToRelease)
921
- )
922
- {
923
- _clipDragPendingElement.ReleasePointer(pointerIdToRelease);
924
- }
925
-
926
- _clipDragPendingElement = null;
927
- }
928
-
929
- if (_loadedClipDropPlaceholder != null)
930
- {
931
- if (_loadedClipDropPlaceholder.parent == _loadedClipsContainer)
932
- {
933
- _loadedClipsContainer.Remove(_loadedClipDropPlaceholder);
934
- }
935
-
936
- _loadedClipDropPlaceholder.style.visibility = Visibility.Hidden;
937
- }
938
- DragAndDrop.SetGenericData("DraggedLoadedClipIndex", null);
939
- }
940
-
941
- private void RecreatePreviewImage()
942
- {
943
- if (_animationPreview != null)
944
- {
945
- if (_animationPreview.parent == _previewPanelHost)
946
- {
947
- _previewPanelHost.Remove(_animationPreview);
948
- }
949
-
950
- _animationPreview = null;
951
- }
952
-
953
- if (_previewPanelHost == null)
954
- {
955
- return;
956
- }
957
-
958
- List<AnimatedSpriteLayer> animatedSpriteLayers = new();
959
- if (_loadedEditorLayers.Count > 0)
960
- {
961
- foreach (EditorLayerData editorLayer in _loadedEditorLayers)
962
- {
963
- animatedSpriteLayers.Add(new AnimatedSpriteLayer(editorLayer.Sprites));
964
- }
965
- }
966
-
967
- _animationPreview = new LayeredImage(
968
- animatedSpriteLayers,
969
- Color.clear,
970
- _currentPreviewFps,
971
- updatesSelf: false
972
- )
973
- {
974
- name = "animationPreviewElement",
975
- };
976
-
977
- _previewPanelHost.Add(_animationPreview);
978
- }
979
-
980
- private void OnFramesContainerDragUpdated(DragUpdatedEvent evt)
981
- {
982
- object draggedIndexData = DragAndDrop.GetGenericData("DraggedFrameDataIndex");
983
- if (draggedIndexData != null && _draggedFrameElement != null)
984
- {
985
- DragAndDrop.visualMode = DragAndDropVisualMode.Move;
986
- float mouseY = evt.localMousePosition.y;
987
- int newVisualIndex = -1;
988
-
989
- if (_frameDropPlaceholder.parent == _framesContainer)
990
- {
991
- _framesContainer.Remove(_frameDropPlaceholder);
992
- }
993
-
994
- for (int i = 0; i < _framesContainer.childCount; i++)
995
- {
996
- VisualElement child = _framesContainer[i];
997
- if (child == _draggedFrameElement)
998
- {
999
- continue;
1000
- }
1001
-
1002
- float childMidY = child.layout.yMin + child.layout.height / 2f;
1003
- if (mouseY < childMidY)
1004
- {
1005
- newVisualIndex = i;
1006
- break;
1007
- }
1008
- }
1009
- if (
1010
- newVisualIndex < 0
1011
- && _framesContainer.childCount > 0
1012
- && _draggedFrameElement
1013
- != _framesContainer.ElementAt(_framesContainer.childCount - 1)
1014
- )
1015
- {
1016
- newVisualIndex = _framesContainer.childCount;
1017
- }
1018
-
1019
- if (0 <= newVisualIndex)
1020
- {
1021
- _framesContainer.Insert(newVisualIndex, _frameDropPlaceholder);
1022
- _frameDropPlaceholder.style.visibility = Visibility.Visible;
1023
- }
1024
- else if (_framesContainer.childCount == 0 && _draggedFrameElement != null)
1025
- {
1026
- _framesContainer.Add(_frameDropPlaceholder);
1027
- _frameDropPlaceholder.style.visibility = Visibility.Visible;
1028
- }
1029
- else
1030
- {
1031
- if (_frameDropPlaceholder.parent == _framesContainer)
1032
- {
1033
- _framesContainer.Remove(_frameDropPlaceholder);
1034
- }
1035
-
1036
- _frameDropPlaceholder.style.visibility = Visibility.Hidden;
1037
- }
1038
- }
1039
- else
1040
- {
1041
- DragAndDrop.visualMode = DragAndDropVisualMode.Rejected;
1042
- }
1043
- evt.StopPropagation();
1044
- }
1045
-
1046
- private void OnFramesContainerDragPerform(DragPerformEvent evt)
1047
- {
1048
- object draggedIndexData = DragAndDrop.GetGenericData("DraggedFrameDataIndex");
1049
- if (
1050
- draggedIndexData != null
1051
- && _draggedFrameElement != null
1052
- && _activeEditorLayer != null
1053
- )
1054
- {
1055
- int originalDataIndex = (int)draggedIndexData;
1056
-
1057
- if (originalDataIndex < 0 || originalDataIndex >= _activeEditorLayer.Sprites.Count)
1058
- {
1059
- this.LogError(
1060
- $"DragPerform (Frames): Stale or invalid dragged index. Aborting drop."
1061
- );
1062
- CleanupFrameDragState(InvalidPointerId);
1063
- evt.StopPropagation();
1064
- return;
1065
- }
1066
-
1067
- Sprite movedSprite = _activeEditorLayer.Sprites[originalDataIndex];
1068
- _activeEditorLayer.Sprites.RemoveAt(originalDataIndex);
1069
-
1070
- int placeholderVisualIndex = _framesContainer.IndexOf(_frameDropPlaceholder);
1071
- int targetDataIndex;
1072
-
1073
- if (0 <= placeholderVisualIndex)
1074
- {
1075
- int itemsBeforePlaceholder = 0;
1076
- for (int i = 0; i < placeholderVisualIndex; i++)
1077
- {
1078
- if (
1079
- _framesContainer[i] != _draggedFrameElement
1080
- && _framesContainer[i] != _frameDropPlaceholder
1081
- )
1082
- {
1083
- itemsBeforePlaceholder++;
1084
- }
1085
- }
1086
- targetDataIndex = itemsBeforePlaceholder;
1087
- }
1088
- else
1089
- {
1090
- targetDataIndex = _activeEditorLayer.Sprites.Count;
1091
- }
1092
- targetDataIndex = Mathf.Clamp(targetDataIndex, 0, _activeEditorLayer.Sprites.Count);
1093
- _activeEditorLayer.Sprites.Insert(targetDataIndex, movedSprite);
1094
-
1095
- DragAndDrop.AcceptDrag();
1096
- CleanupFrameDragState(InvalidPointerId);
1097
-
1098
- RebuildFramesListUI();
1099
- RecreatePreviewImage();
1100
- }
1101
- else
1102
- {
1103
- if (DragAndDrop.GetGenericData("DraggedFrameDataIndex") != null)
1104
- {
1105
- CleanupFrameDragState(InvalidPointerId);
1106
- }
1107
- }
1108
- evt.StopPropagation();
1109
- }
1110
-
1111
- private void OnFramesContainerDragLeave(DragLeaveEvent evt)
1112
- {
1113
- if (evt.target == _framesContainer)
1114
- {
1115
- if (_frameDropPlaceholder.parent == _framesContainer)
1116
- {
1117
- _framesContainer.Remove(_frameDropPlaceholder);
1118
- }
1119
-
1120
- if (_frameDropPlaceholder != null)
1121
- {
1122
- _frameDropPlaceholder.style.visibility = Visibility.Hidden;
1123
- }
1124
- }
1125
-
1126
- CleanupFrameDragState(InvalidPointerId);
1127
- }
1128
-
1129
- private void CleanupFrameDragState(int pointerIdToRelease)
1130
- {
1131
- this.Log($"Cleaning up frame drag state with pointer {pointerIdToRelease}");
1132
- if (_draggedFrameElement != null)
1133
- {
1134
- if (
1135
- pointerIdToRelease != InvalidPointerId
1136
- && _draggedFrameElement.HasPointerCapture(pointerIdToRelease)
1137
- )
1138
- {
1139
- _draggedFrameElement.ReleasePointer(pointerIdToRelease);
1140
- }
1141
-
1142
- _draggedFrameElement.UnregisterCallback<PointerUpEvent>(
1143
- OnDraggedFrameItemPointerUp
1144
- );
1145
- _draggedFrameElement.RemoveFromClassList("frame-item-dragged");
1146
- _draggedFrameElement = null;
1147
- }
1148
- _draggedFrameOriginalDataIndex = -1;
1149
-
1150
- if (_frameDropPlaceholder != null)
1151
- {
1152
- if (_frameDropPlaceholder.parent == _framesContainer)
1153
- {
1154
- _framesContainer.Remove(_frameDropPlaceholder);
1155
- }
1156
-
1157
- _frameDropPlaceholder.style.visibility = Visibility.Hidden;
1158
- }
1159
- DragAndDrop.SetGenericData("DraggedFrameDataIndex", null);
1160
- }
1161
-
1162
- private void UpdateFpsDebugLabelForActiveLayer()
1163
- {
1164
- if (_activeEditorLayer == null)
1165
- {
1166
- _fpsDebugLabel.text = "Detected FPS Info: No active clip.";
1167
- return;
1168
- }
1169
-
1170
- _fpsDebugLabel.text =
1171
- $"Active Clip FPS (Original): {FormatFps(_activeEditorLayer.OriginalClipFps)}fps. Preview uses global FPS.";
1172
- }
1173
-
1174
- private static string FormatFps(float fps)
1175
- {
1176
- return fps.ToString("F1");
1177
- }
1178
-
1179
- private void RebuildFramesListUI()
1180
- {
1181
- _framesContainer.Clear();
1182
-
1183
- if (_frameDropPlaceholder != null && _frameDropPlaceholder.parent == _framesContainer)
1184
- {
1185
- _framesContainer.Remove(_frameDropPlaceholder);
1186
- }
1187
-
1188
- if (_activeEditorLayer?.Sprites == null)
1189
- {
1190
- return;
1191
- }
1192
-
1193
- for (int i = 0; i < _activeEditorLayer.Sprites.Count; i++)
1194
- {
1195
- Sprite sprite = _activeEditorLayer.Sprites[i];
1196
-
1197
- VisualElement frameElement = new();
1198
- frameElement.AddToClassList("frame-item");
1199
-
1200
- Image frameImage = new() { sprite = sprite, scaleMode = ScaleMode.ScaleToFit };
1201
- frameImage.AddToClassList("frame-image");
1202
- frameElement.Add(frameImage);
1203
-
1204
- VisualElement frameInfo = new();
1205
- frameInfo.AddToClassList("frame-info");
1206
- frameInfo.Add(new Label($"Frame: {i + 1}"));
1207
- frameInfo.Add(new Label($"Sprite: {(sprite != null ? sprite.name : "(None)")}"));
1208
- frameElement.Add(frameInfo);
1209
-
1210
- IntegerField indexField = new(null) { value = i + 1 };
1211
- indexField.AddToClassList("frame-index-field");
1212
- frameElement.Add(indexField);
1213
-
1214
- VisualElement orderFieldContainer = new()
1215
- {
1216
- style =
1217
- {
1218
- flexDirection = FlexDirection.Row,
1219
- alignItems = Align.Center,
1220
- marginLeft = StyleKeyword.Auto,
1221
- },
1222
- };
1223
-
1224
- Label orderLabel = new("Order:") { style = { marginRight = 3 } };
1225
- orderFieldContainer.Add(orderLabel);
1226
- orderFieldContainer.Add(indexField);
1227
- frameElement.Add(orderFieldContainer);
1228
-
1229
- int currentDataIndex = i;
1230
- frameElement.RegisterCallback<PointerDownEvent>(evt =>
1231
- OnFrameItemPointerDown(evt, frameElement, currentDataIndex)
1232
- );
1233
-
1234
- indexField.userData = currentDataIndex;
1235
-
1236
- indexField.RegisterCallback<FocusInEvent>(_ =>
1237
- {
1238
- CleanupFrameDragState(InvalidPointerId);
1239
- CleanupLoadedClipDragState(InvalidPointerId);
1240
- });
1241
-
1242
- indexField.RegisterCallback<FocusOutEvent>(_ =>
1243
- OnFrameIndexFieldChanged(indexField)
1244
- );
1245
- indexField.RegisterCallback<KeyDownEvent>(evt =>
1246
- {
1247
- if (evt.keyCode is KeyCode.Return or KeyCode.KeypadEnter)
1248
- {
1249
- OnFrameIndexFieldChanged(indexField);
1250
- indexField.Blur();
1251
- }
1252
- });
1253
-
1254
- _framesContainer.Add(frameElement);
1255
- }
1256
- }
1257
-
1258
- private void OnFrameIndexFieldChanged(IntegerField field)
1259
- {
1260
- CleanupFrameDragState(InvalidPointerId);
1261
- CleanupLoadedClipDragState(InvalidPointerId);
1262
- if (_activeEditorLayer?.Sprites == null)
1263
- {
1264
- return;
1265
- }
1266
-
1267
- int originalDataIndex = (int)field.userData;
1268
- int newUiIndex = field.value;
1269
- int newRequestedDataIndex = newUiIndex - 1;
1270
- int newClampedDataIndex = Mathf.Clamp(
1271
- newRequestedDataIndex,
1272
- 0,
1273
- _activeEditorLayer.Sprites.Count - 1
1274
- );
1275
-
1276
- if (newClampedDataIndex != originalDataIndex)
1277
- {
1278
- if (originalDataIndex < 0 || originalDataIndex >= _activeEditorLayer.Sprites.Count)
1279
- {
1280
- this.LogWarn(
1281
- $"Original index {originalDataIndex} out of bounds. Rebuilding UI to correct."
1282
- );
1283
- RebuildFramesListUI();
1284
- return;
1285
- }
1286
- Sprite spriteToMove = _activeEditorLayer.Sprites[originalDataIndex];
1287
- _activeEditorLayer.Sprites.RemoveAt(originalDataIndex);
1288
- _activeEditorLayer.Sprites.Insert(newClampedDataIndex, spriteToMove);
1289
- RebuildFramesListUI();
1290
- RecreatePreviewImage();
1291
- }
1292
- else if (newUiIndex - 1 != newClampedDataIndex)
1293
- {
1294
- RebuildFramesListUI();
1295
- }
1296
- }
1297
-
1298
- private void OnFrameItemPointerDown(
1299
- PointerDownEvent evt,
1300
- VisualElement frameElement,
1301
- int originalDataIndex
1302
- )
1303
- {
1304
- if (evt.button != 0 || _draggedFrameElement != null)
1305
- {
1306
- return;
1307
- }
1308
-
1309
- if (
1310
- _activeEditorLayer == null
1311
- || originalDataIndex < 0
1312
- || originalDataIndex >= _activeEditorLayer.Sprites.Count
1313
- )
1314
- {
1315
- this.LogError(
1316
- $"OnFrameItemPointerDown: Invalid originalDataIndex ({originalDataIndex}) or no active layer. Sprite count: {_activeEditorLayer?.Sprites?.Count ?? -1}"
1317
- );
1318
- return;
1319
- }
1320
-
1321
- _draggedFrameElement = frameElement;
1322
- _draggedFrameOriginalDataIndex = originalDataIndex;
1323
-
1324
- try
1325
- {
1326
- _draggedFrameElement.RegisterCallback<PointerUpEvent>(OnDraggedFrameItemPointerUp);
1327
- _draggedFrameElement.AddToClassList("frame-item-dragged");
1328
-
1329
- DragAndDrop.PrepareStartDrag();
1330
- DragAndDrop.SetGenericData("DraggedFrameDataIndex", _draggedFrameOriginalDataIndex);
1331
-
1332
- Object dragContextObject =
1333
- _activeEditorLayer.SourceClip ?? (Object)CreateInstance<ScriptableObject>();
1334
- if (dragContextObject == null)
1335
- {
1336
- this.LogError($"Failed to create dragContextObject for frame drag.");
1337
-
1338
- _draggedFrameElement.ReleasePointer(evt.pointerId);
1339
- _draggedFrameElement.UnregisterCallback<PointerUpEvent>(
1340
- OnDraggedFrameItemPointerUp
1341
- );
1342
- _draggedFrameElement.RemoveFromClassList("frame-item-dragged");
1343
- _draggedFrameElement = null;
1344
- return;
1345
- }
1346
- DragAndDrop.objectReferences = new[] { dragContextObject };
1347
-
1348
- Sprite spriteBeingDragged = _activeEditorLayer.Sprites[originalDataIndex];
1349
- string dragTitle;
1350
- if (spriteBeingDragged != null)
1351
- {
1352
- dragTitle = !string.IsNullOrWhiteSpace(spriteBeingDragged.name)
1353
- ? spriteBeingDragged.name
1354
- : $"Unnamed Sprite Frame {originalDataIndex + 1}";
1355
- }
1356
- else
1357
- {
1358
- dragTitle = $"Empty Frame {originalDataIndex + 1}";
1359
- }
1360
-
1361
- if (string.IsNullOrWhiteSpace(dragTitle))
1362
- {
1363
- dragTitle = "Dragging Frame";
1364
- }
1365
-
1366
- DragAndDrop.StartDrag(dragTitle);
1367
- }
1368
- catch (Exception e)
1369
- {
1370
- this.LogError(
1371
- $"Exception during OnFrameItemPointerDown before StartDrag: {e.Message}\n{e.StackTrace}"
1372
- );
1373
-
1374
- if (_draggedFrameElement != null)
1375
- {
1376
- if (_draggedFrameElement.HasPointerCapture(evt.pointerId))
1377
- {
1378
- _draggedFrameElement.ReleasePointer(evt.pointerId);
1379
- }
1380
-
1381
- _draggedFrameElement.UnregisterCallback<PointerUpEvent>(
1382
- OnDraggedFrameItemPointerUp
1383
- );
1384
- _draggedFrameElement.RemoveFromClassList("frame-item-dragged");
1385
- _draggedFrameElement = null;
1386
- }
1387
- _draggedFrameOriginalDataIndex = -1;
1388
- }
1389
- }
1390
-
1391
- private void OnDraggedFrameItemPointerUp(PointerUpEvent evt)
1392
- {
1393
- if (_draggedFrameElement == null || evt.currentTarget != _draggedFrameElement)
1394
- {
1395
- return;
1396
- }
1397
-
1398
- if (DragAndDrop.GetGenericData("DraggedFrameDataIndex") != null)
1399
- {
1400
- CleanupFrameDragState(evt.pointerId);
1401
- }
1402
- else if (
1403
- _draggedFrameElement != null
1404
- && _draggedFrameElement.HasPointerCapture(evt.pointerId)
1405
- )
1406
- {
1407
- _draggedFrameElement.ReleasePointer(evt.pointerId);
1408
- _draggedFrameElement.UnregisterCallback<PointerUpEvent>(
1409
- OnDraggedFrameItemPointerUp
1410
- );
1411
- _draggedFrameElement.RemoveFromClassList("frame-item-dragged");
1412
- _draggedFrameElement = null;
1413
- }
1414
- evt.StopPropagation();
1415
- }
1416
-
1417
- private void OnApplyFpsToPreviewClicked()
1418
- {
1419
- _currentPreviewFps = Mathf.Max(0.1f, _fpsField.value);
1420
- _fpsField.SetValueWithoutNotify(_currentPreviewFps);
1421
- if (_animationPreview != null)
1422
- {
1423
- _animationPreview.Fps = _currentPreviewFps;
1424
- }
1425
- }
1426
-
1427
- private void OnSaveClipClicked()
1428
- {
1429
- if (_activeEditorLayer == null || _activeEditorLayer.SourceClip == null)
1430
- {
1431
- this.LogError($"No active animation clip to save.");
1432
- return;
1433
- }
1434
-
1435
- AnimationClip clipToSave = _activeEditorLayer.SourceClip;
1436
- string bindingPath = _activeEditorLayer.BindingPath;
1437
-
1438
- EditorCurveBinding spriteBinding = default;
1439
- bool bindingFound = false;
1440
- EditorCurveBinding[] allBindings = AnimationUtility.GetObjectReferenceCurveBindings(
1441
- clipToSave
1442
- );
1443
-
1444
- foreach (EditorCurveBinding b in allBindings)
1445
- {
1446
- if (
1447
- b.type == typeof(SpriteRenderer)
1448
- && b.propertyName == "m_Sprite"
1449
- && (string.IsNullOrWhiteSpace(bindingPath) || b.path == bindingPath)
1450
- )
1451
- {
1452
- spriteBinding = b;
1453
- bindingFound = true;
1454
- break;
1455
- }
1456
- }
1457
-
1458
- if (!bindingFound)
1459
- {
1460
- foreach (EditorCurveBinding b in allBindings)
1461
- {
1462
- if (b.type == typeof(SpriteRenderer) && b.propertyName == "m_Sprite")
1463
- {
1464
- spriteBinding = b;
1465
- bindingFound = true;
1466
- this.LogWarn(
1467
- $"Saving to first available m_Sprite binding on '{clipToSave.name}' as specific path '{bindingPath}' was not found or empty."
1468
- );
1469
- break;
1470
- }
1471
- }
1472
- }
1473
-
1474
- if (!bindingFound)
1475
- {
1476
- this.LogError(
1477
- $"Cannot save '{clipToSave.name}': No SpriteRenderer m_Sprite binding found (Path Hint: '{bindingPath}'). Clip might be empty or not a sprite animation."
1478
- );
1479
- return;
1480
- }
1481
-
1482
- List<Sprite> spritesToSave = _activeEditorLayer.Sprites;
1483
- ObjectReferenceKeyframe[] newKeyframes = new ObjectReferenceKeyframe[
1484
- spritesToSave.Count
1485
- ];
1486
- float timePerFrame = _currentPreviewFps > 0 ? 1.0f / _currentPreviewFps : 0f;
1487
-
1488
- for (int i = 0; i < spritesToSave.Count; i++)
1489
- {
1490
- newKeyframes[i] = new ObjectReferenceKeyframe
1491
- {
1492
- time = i * timePerFrame,
1493
- value = spritesToSave[i],
1494
- };
1495
- }
1496
-
1497
- Undo.RecordObject(clipToSave, "Modify Animation Clip Frames");
1498
- AnimationUtility.SetObjectReferenceCurve(clipToSave, spriteBinding, newKeyframes);
1499
- clipToSave.frameRate = _currentPreviewFps;
1500
-
1501
- EditorUtility.SetDirty(clipToSave);
1502
- AssetDatabase.SaveAssets();
1503
-
1504
- this.Log(
1505
- $"Animation clip '{clipToSave.name}' saved with {spritesToSave.Count} frames at {_currentPreviewFps} FPS."
1506
- );
1507
- }
1508
-
1509
- private void OnDisable()
1510
- {
1511
- CleanupFrameDragState(InvalidPointerId);
1512
- CleanupLoadedClipDragState(InvalidPointerId);
1513
-
1514
- if (_animationPreview != null && _animationPreview.parent == _previewPanelHost)
1515
- {
1516
- _previewPanelHost.Remove(_animationPreview);
1517
- }
1518
- _animationPreview = null;
1519
- }
1520
- }
1521
- #endif
1522
- }
1
+ // ReSharper disable HeapView.CanAvoidClosure
2
+ namespace WallstopStudios.UnityHelpers.Editor.Sprites
3
+ {
4
+ #if UNITY_EDITOR
5
+ using System;
6
+ using System.Collections.Generic;
7
+ using System.IO;
8
+ using System.Linq;
9
+ using UnityEditor;
10
+ using UnityEditor.UIElements;
11
+ using UnityEngine;
12
+ using UnityEngine.UIElements;
13
+ using WallstopStudios.UnityHelpers.Core.Extension;
14
+ using WallstopStudios.UnityHelpers.Core.Helper;
15
+ using WallstopStudios.UnityHelpers.Editor;
16
+ using WallstopStudios.UnityHelpers.Visuals;
17
+ using WallstopStudios.UnityHelpers.Visuals.UIToolkit;
18
+ using Object = UnityEngine.Object;
19
+
20
+ /// <summary>
21
+ /// UI Toolkit-based multi-clip 2D animation viewer and lightweight editor. Load multiple
22
+ /// AnimationClips, preview layered sprite animation, reorder frames via drag & drop, adjust
23
+ /// preview FPS, and save an updated clip back to disk.
24
+ /// </summary>
25
+ /// <remarks>
26
+ /// <para>
27
+ /// Problems this solves: quickly auditing and tweaking sprite-based clips without opening the
28
+ /// full Animation window workflow; comparing multiple clips; and adjusting timing visually.
29
+ /// </para>
30
+ /// <para>
31
+ /// How it works: for a selected clip, the tool resolves the <see cref="SpriteRenderer"/>
32
+ /// binding path and extracts its frames. The frames list supports reordering via drag & drop
33
+ /// with placeholders for clarity. Preview uses an in-editor <c>LayeredImage</c> to animate the
34
+ /// sprite sequence at the chosen FPS.
35
+ /// </para>
36
+ /// <para>
37
+ /// Usage:
38
+ /// </para>
39
+ /// <list type="bullet">
40
+ /// <item><description>Open via menu: Tools/Wallstop Studios/Unity Helpers/Sprite Animation Editor.</description></item>
41
+ /// <item><description>Add clips (object field or project selection button).</description></item>
42
+ /// <item><description>Drag frames to reorder, then Save to write an updated clip.</description></item>
43
+ /// </list>
44
+ /// <para>
45
+ /// Pros: intuitive drag/drop, live preview, handles multiple clips in a session.
46
+ /// Caveats: operates on SpriteRenderer curves only; saving overwrites the target clip asset.
47
+ /// </para>
48
+ /// </remarks>
49
+ public sealed class AnimationViewerWindow : EditorWindow
50
+ {
51
+ private const string PackageId = "com.wallstop-studios.unity-helpers";
52
+ private const float DragThresholdSqrMagnitude = 10f * 10f;
53
+ private const int InvalidPointerId = -1;
54
+ private const string DirToolName = "SpriteAnimationEditor";
55
+ private const string DirContextKey = "Clips";
56
+
57
+ internal sealed class EditorLayerData
58
+ {
59
+ public AnimationClip SourceClip { get; }
60
+ public List<Sprite> Sprites { get; }
61
+ public string ClipName => SourceClip != null ? SourceClip.name : "Unnamed Layer";
62
+ public float OriginalClipFps { get; }
63
+ public string BindingPath { get; }
64
+
65
+ public EditorLayerData(AnimationClip clip)
66
+ {
67
+ SourceClip = clip;
68
+ Sprites = new List<Sprite>();
69
+ if (clip != null)
70
+ {
71
+ foreach (Sprite s in clip.GetSpritesFromClip())
72
+ {
73
+ if (s != null)
74
+ {
75
+ Sprites.Add(s);
76
+ }
77
+ }
78
+ }
79
+ OriginalClipFps =
80
+ clip.frameRate > 0 ? clip.frameRate : AnimatedSpriteLayer.FrameRate;
81
+
82
+ BindingPath = string.Empty;
83
+ if (SourceClip != null)
84
+ {
85
+ foreach (
86
+ EditorCurveBinding binding in AnimationUtility.GetObjectReferenceCurveBindings(
87
+ SourceClip
88
+ )
89
+ )
90
+ {
91
+ if (
92
+ binding.type == typeof(SpriteRenderer)
93
+ && string.Equals(
94
+ binding.propertyName,
95
+ "m_Sprite",
96
+ StringComparison.Ordinal
97
+ )
98
+ )
99
+ {
100
+ BindingPath = binding.path;
101
+ break;
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
107
+
108
+ [MenuItem("Tools/Wallstop Studios/Unity Helpers/Sprite Animation Editor")]
109
+ public static void ShowWindow()
110
+ {
111
+ AnimationViewerWindow wnd = GetWindow<AnimationViewerWindow>();
112
+ wnd.titleContent = new GUIContent("2D Animation Viewer");
113
+ wnd.minSize = new Vector2(750, 500);
114
+ }
115
+
116
+ private VisualTreeAsset _visualTree;
117
+ private StyleSheet _styleSheet;
118
+
119
+ private ObjectField _addAnimationClipField;
120
+ private Button _browseAndAddButton;
121
+ private FloatField _fpsField;
122
+ private Button _applyFpsButton;
123
+ private Button _saveClipButton;
124
+ private VisualElement _loadedClipsContainer;
125
+ private VisualElement _previewPanelHost;
126
+ private LayeredImage _animationPreview;
127
+ private VisualElement _framesContainer;
128
+ private Label _fpsDebugLabel;
129
+ private Label _framesPanelTitle;
130
+ private MultiFileSelectorElement _fileSelector;
131
+
132
+ private readonly List<EditorLayerData> _loadedEditorLayers = new();
133
+
134
+ private EditorLayerData _activeEditorLayer;
135
+ private float _currentPreviewFps = AnimatedSpriteLayer.FrameRate;
136
+
137
+ private VisualElement _draggedFrameElement;
138
+ private int _draggedFrameOriginalDataIndex;
139
+ private VisualElement _frameDropPlaceholder;
140
+
141
+ private VisualElement _draggedLoadedClipElement;
142
+ private int _draggedLoadedClipOriginalIndex;
143
+ private VisualElement _loadedClipDropPlaceholder;
144
+
145
+ private bool _isClipDragPending;
146
+ private Vector3 _clipDragStartPosition;
147
+ private VisualElement _clipDragPendingElement;
148
+ private int _clipDragPendingOriginalIndex;
149
+
150
+ public void CreateGUI()
151
+ {
152
+ VisualElement root = rootVisualElement;
153
+
154
+ TryLoadStyleSheets();
155
+
156
+ if (_visualTree == null)
157
+ {
158
+ root.Add(new Label("Error: AnimationViewer.uxml not found."));
159
+ return;
160
+ }
161
+ if (_styleSheet != null)
162
+ {
163
+ root.styleSheets.Add(_styleSheet);
164
+ }
165
+
166
+ _visualTree.CloneTree(root);
167
+
168
+ _addAnimationClipField = root.Q<ObjectField>("addAnimationClipField");
169
+ _browseAndAddButton = root.Q<Button>("browseAndAddButton");
170
+ _fpsField = root.Q<FloatField>("fpsField");
171
+ _applyFpsButton = root.Q<Button>("applyFpsButton");
172
+ _saveClipButton = root.Q<Button>("saveClipButton");
173
+ _loadedClipsContainer = root.Q<VisualElement>("loadedClipsContainer");
174
+ _previewPanelHost = root.Q<VisualElement>("preview-panel");
175
+ _framesContainer = root.Q<VisualElement>("framesContainer");
176
+ _fpsDebugLabel = root.Q<Label>("fpsDebugLabel");
177
+ _framesPanelTitle = root.Q<Label>("framesPanelTitle");
178
+
179
+ _previewPanelHost.AddToClassList("animation-preview-container");
180
+
181
+ _fpsField.value = _currentPreviewFps;
182
+ _saveClipButton.SetEnabled(false);
183
+
184
+ _addAnimationClipField.RegisterValueChangedCallback(OnAddAnimationClipFieldChanged);
185
+ _browseAndAddButton.text = "Add Selected Clips from Project";
186
+ _browseAndAddButton.clicked -= OnBrowseAndAddClicked;
187
+ if (_browseAndAddButton != null)
188
+ {
189
+ _browseAndAddButton.text = "Browse Clips (Multi)...";
190
+ _browseAndAddButton.clicked -= OnAddSelectedClipsFromProjectClicked;
191
+ _browseAndAddButton.clicked += ToggleMultiFileSelector;
192
+ }
193
+ else
194
+ {
195
+ this.LogError(
196
+ $"'browseAndAddButton' not found in UXML. Multi-file browser cannot be triggered."
197
+ );
198
+ }
199
+ _applyFpsButton.clicked += OnApplyFpsToPreviewClicked;
200
+ _saveClipButton.clicked += OnSaveClipClicked;
201
+
202
+ _frameDropPlaceholder = new VisualElement();
203
+ _frameDropPlaceholder.AddToClassList("drop-placeholder");
204
+ _frameDropPlaceholder.style.height = 5;
205
+ _frameDropPlaceholder.style.visibility = Visibility.Hidden;
206
+
207
+ _framesContainer.RegisterCallback<DragUpdatedEvent>(OnFramesContainerDragUpdated);
208
+ _framesContainer.RegisterCallback<DragPerformEvent>(OnFramesContainerDragPerform);
209
+ _framesContainer.RegisterCallback<DragLeaveEvent>(OnFramesContainerDragLeave);
210
+
211
+ _loadedClipDropPlaceholder = new VisualElement();
212
+ _loadedClipDropPlaceholder.AddToClassList("drop-placeholder");
213
+ _loadedClipDropPlaceholder.style.height = 5;
214
+ _loadedClipDropPlaceholder.style.visibility = Visibility.Hidden;
215
+
216
+ _loadedClipsContainer.RegisterCallback<DragUpdatedEvent>(
217
+ OnLoadedClipsContainerDragUpdated
218
+ );
219
+ _loadedClipsContainer.RegisterCallback<DragPerformEvent>(
220
+ OnLoadedClipsContainerDragPerform
221
+ );
222
+ _loadedClipsContainer.RegisterCallback<DragLeaveEvent>(OnLoadedClipsContainerDragLeave);
223
+
224
+ UpdateFramesPanelTitle();
225
+ RebuildLoadedClipsUI();
226
+ RecreatePreviewImage();
227
+ }
228
+
229
+ private void Update()
230
+ {
231
+ _animationPreview?.Update();
232
+ }
233
+
234
+ private void TryLoadStyleSheets()
235
+ {
236
+ string packageRoot = DirectoryHelper.FindPackageRootPath(
237
+ DirectoryHelper.GetCallerScriptDirectory()
238
+ );
239
+ if (!string.IsNullOrWhiteSpace(packageRoot))
240
+ {
241
+ if (
242
+ packageRoot.StartsWith("Packages", StringComparison.OrdinalIgnoreCase)
243
+ && !packageRoot.Contains(PackageId, StringComparison.OrdinalIgnoreCase)
244
+ )
245
+ {
246
+ int helpersIndex = packageRoot.LastIndexOf(
247
+ "UnityHelpers",
248
+ StringComparison.Ordinal
249
+ );
250
+ if (0 <= helpersIndex)
251
+ {
252
+ packageRoot = packageRoot[..helpersIndex];
253
+ packageRoot += PackageId;
254
+ }
255
+ }
256
+
257
+ char pathSeparator = Path.DirectorySeparatorChar;
258
+ string styleSheetPath =
259
+ $"{packageRoot}{pathSeparator}Editor{pathSeparator}Styles{pathSeparator}AnimationViewer.uss";
260
+ string unityRelativeStyleSheetPath = DirectoryHelper.AbsoluteToUnityRelativePath(
261
+ styleSheetPath
262
+ );
263
+ unityRelativeStyleSheetPath = unityRelativeStyleSheetPath.SanitizePath();
264
+
265
+ const string packageCache = "PackageCache/";
266
+ int packageCacheIndex;
267
+ if (!string.IsNullOrWhiteSpace(unityRelativeStyleSheetPath))
268
+ {
269
+ _styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>(
270
+ unityRelativeStyleSheetPath
271
+ );
272
+ }
273
+
274
+ if (_styleSheet == null && !string.IsNullOrWhiteSpace(unityRelativeStyleSheetPath))
275
+ {
276
+ packageCacheIndex = unityRelativeStyleSheetPath.IndexOf(
277
+ packageCache,
278
+ StringComparison.OrdinalIgnoreCase
279
+ );
280
+ if (0 <= packageCacheIndex)
281
+ {
282
+ unityRelativeStyleSheetPath = unityRelativeStyleSheetPath[
283
+ (packageCacheIndex + packageCache.Length)..
284
+ ];
285
+ int forwardIndex = unityRelativeStyleSheetPath.IndexOf(
286
+ "/",
287
+ StringComparison.Ordinal
288
+ );
289
+ if (0 <= forwardIndex)
290
+ {
291
+ unityRelativeStyleSheetPath = unityRelativeStyleSheetPath.Substring(
292
+ forwardIndex
293
+ );
294
+ unityRelativeStyleSheetPath =
295
+ "Packages/" + PackageId + "/" + unityRelativeStyleSheetPath;
296
+ }
297
+ else
298
+ {
299
+ unityRelativeStyleSheetPath = "Packages/" + unityRelativeStyleSheetPath;
300
+ }
301
+ }
302
+
303
+ if (!string.IsNullOrWhiteSpace(unityRelativeStyleSheetPath))
304
+ {
305
+ _styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>(
306
+ unityRelativeStyleSheetPath
307
+ );
308
+ if (_styleSheet == null)
309
+ {
310
+ this.LogError(
311
+ $"Failed to load Animation Viewer style sheet (package root: '{packageRoot}'), relative path '{unityRelativeStyleSheetPath}'."
312
+ );
313
+ }
314
+ }
315
+ else
316
+ {
317
+ this.LogError(
318
+ $"Failed to convert absolute path '{styleSheetPath}' to Unity relative path."
319
+ );
320
+ }
321
+ }
322
+
323
+ string visualTreePath =
324
+ $"{packageRoot}{pathSeparator}Editor{pathSeparator}Styles{pathSeparator}AnimationViewer.uxml";
325
+ string unityRelativeVisualTreePath = DirectoryHelper.AbsoluteToUnityRelativePath(
326
+ visualTreePath
327
+ );
328
+
329
+ _visualTree = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
330
+ unityRelativeVisualTreePath
331
+ );
332
+ if (_visualTree == null)
333
+ {
334
+ packageCacheIndex = unityRelativeVisualTreePath.IndexOf(
335
+ packageCache,
336
+ StringComparison.OrdinalIgnoreCase
337
+ );
338
+ if (0 <= packageCacheIndex)
339
+ {
340
+ unityRelativeVisualTreePath = unityRelativeVisualTreePath[
341
+ (packageCacheIndex + packageCache.Length)..
342
+ ];
343
+ int forwardIndex = unityRelativeVisualTreePath.IndexOf(
344
+ "/",
345
+ StringComparison.Ordinal
346
+ );
347
+ if (0 <= forwardIndex)
348
+ {
349
+ unityRelativeVisualTreePath = unityRelativeVisualTreePath.Substring(
350
+ forwardIndex
351
+ );
352
+ unityRelativeVisualTreePath =
353
+ "Packages/" + PackageId + "/" + unityRelativeVisualTreePath;
354
+ }
355
+ else
356
+ {
357
+ unityRelativeVisualTreePath = "Packages/" + unityRelativeVisualTreePath;
358
+ }
359
+ }
360
+
361
+ if (!string.IsNullOrWhiteSpace(unityRelativeVisualTreePath))
362
+ {
363
+ _visualTree = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
364
+ unityRelativeVisualTreePath
365
+ );
366
+ }
367
+ }
368
+ }
369
+ else
370
+ {
371
+ this.LogError(
372
+ $"Failed to find Animation Viewer style sheet (package root: '{packageRoot}')."
373
+ );
374
+ }
375
+ }
376
+
377
+ private void ToggleMultiFileSelector()
378
+ {
379
+ VisualElement root = rootVisualElement;
380
+ if (_fileSelector == null)
381
+ {
382
+ _fileSelector = new MultiFileSelectorElement(
383
+ GetLastAnimationDirectory(),
384
+ new[] { ".anim" }
385
+ );
386
+ _fileSelector.OnFilesSelected += HandleFilesSelectedFromCustomBrowser;
387
+ _fileSelector.OnCancelled += HideMultiFileSelector;
388
+ root.Add(_fileSelector);
389
+ if (root.childCount > 1)
390
+ {
391
+ _fileSelector.PlaceInFront(root.Children().FirstOrDefault());
392
+ }
393
+ }
394
+ else if (_fileSelector.parent == null)
395
+ {
396
+ _fileSelector.ResetAndShow(GetLastAnimationDirectory());
397
+ root.Add(_fileSelector);
398
+ if (root.childCount > 1)
399
+ {
400
+ _fileSelector.PlaceInFront(root.Children().FirstOrDefault());
401
+ }
402
+ }
403
+ else
404
+ {
405
+ HideMultiFileSelector();
406
+ }
407
+ }
408
+
409
+ private void HideMultiFileSelector()
410
+ {
411
+ if (_fileSelector is { parent: not null })
412
+ {
413
+ _fileSelector.parent.Remove(_fileSelector);
414
+ }
415
+ }
416
+
417
+ private void HandleFilesSelectedFromCustomBrowser(List<string> selectedFullPaths)
418
+ {
419
+ HideMultiFileSelector();
420
+
421
+ if (selectedFullPaths == null || selectedFullPaths.Count == 0)
422
+ {
423
+ return;
424
+ }
425
+
426
+ int clipsAddedCount = 0;
427
+ string lastValidDirectory = null;
428
+
429
+ foreach (string fullPath in selectedFullPaths)
430
+ {
431
+ string assetPath = fullPath.SanitizePath();
432
+ if (!assetPath.StartsWith("Assets", StringComparison.OrdinalIgnoreCase))
433
+ {
434
+ if (
435
+ assetPath.StartsWith(
436
+ Application.dataPath,
437
+ StringComparison.OrdinalIgnoreCase
438
+ )
439
+ )
440
+ {
441
+ assetPath = "Assets" + assetPath.Substring(Application.dataPath.Length);
442
+ }
443
+ else
444
+ {
445
+ this.LogWarn(
446
+ $"Selected file '{fullPath}' is outside the project's Assets folder or path is not project-relative. Skipping."
447
+ );
448
+ continue;
449
+ }
450
+ }
451
+
452
+ AnimationClip clip = AssetDatabase.LoadAssetAtPath<AnimationClip>(assetPath);
453
+ if (clip != null)
454
+ {
455
+ bool noneMatch = true;
456
+ for (int i = 0; i < _loadedEditorLayers.Count; i++)
457
+ {
458
+ if (_loadedEditorLayers[i]?.SourceClip == clip)
459
+ {
460
+ noneMatch = false;
461
+ break;
462
+ }
463
+ }
464
+ if (noneMatch)
465
+ {
466
+ AddEditorLayer(clip);
467
+ clipsAddedCount++;
468
+ lastValidDirectory = Path.GetDirectoryName(assetPath);
469
+ }
470
+ else
471
+ {
472
+ this.LogWarn($"Clip '{clip.name}' already loaded. Skipping.");
473
+ }
474
+ }
475
+ else
476
+ {
477
+ this.LogWarn($"Could not load AnimationClip from: {assetPath}");
478
+ }
479
+ }
480
+
481
+ if (clipsAddedCount > 0)
482
+ {
483
+ this.Log($"Added {clipsAddedCount} clip(s).");
484
+ if (!string.IsNullOrWhiteSpace(lastValidDirectory))
485
+ {
486
+ RecordLastAnimationDirectory(lastValidDirectory);
487
+ }
488
+ }
489
+ }
490
+
491
+ private void OnAddAnimationClipFieldChanged(ChangeEvent<Object> evt)
492
+ {
493
+ AnimationClip clip = evt.newValue as AnimationClip;
494
+ if (clip != null)
495
+ {
496
+ AddEditorLayer(clip);
497
+ _addAnimationClipField.SetValueWithoutNotify(null);
498
+ }
499
+ }
500
+
501
+ private void OnAddSelectedClipsFromProjectClicked()
502
+ {
503
+ Object[] selectedObjects = Selection.GetFiltered(
504
+ typeof(AnimationClip),
505
+ SelectionMode.Assets
506
+ );
507
+
508
+ if (selectedObjects == null || selectedObjects.Length == 0)
509
+ {
510
+ Utils.EditorUi.Info(
511
+ "No Clips Selected",
512
+ "Please select one or more AnimationClip assets in the Project window first."
513
+ );
514
+ return;
515
+ }
516
+
517
+ int clipsAddedCount = 0;
518
+ foreach (Object obj in selectedObjects)
519
+ {
520
+ if (obj is AnimationClip clip)
521
+ {
522
+ bool alreadyExists = false;
523
+ for (int i = 0; i < _loadedEditorLayers.Count; i++)
524
+ {
525
+ if (_loadedEditorLayers[i]?.SourceClip == clip)
526
+ {
527
+ alreadyExists = true;
528
+ break;
529
+ }
530
+ }
531
+ if (!alreadyExists)
532
+ {
533
+ AddEditorLayer(clip);
534
+ clipsAddedCount++;
535
+ }
536
+ else
537
+ {
538
+ this.LogWarn($"Clip '{clip.name}' is already loaded. Skipping.");
539
+ }
540
+ }
541
+ }
542
+
543
+ if (clipsAddedCount > 0)
544
+ {
545
+ this.Log($"Added {clipsAddedCount} new AnimationClip(s) to the viewer.");
546
+ }
547
+ else if (selectedObjects.Length > 0)
548
+ {
549
+ this.Log($"All selected AnimationClips were already loaded.");
550
+ }
551
+ }
552
+
553
+ private void OnBrowseAndAddClicked()
554
+ {
555
+ string path = EditorUtility.OpenFilePanelWithFilters(
556
+ "Select Animation Clip to Add",
557
+ GetLastAnimationDirectory(),
558
+ new[] { "Animation Clip", "anim" }
559
+ );
560
+
561
+ if (!string.IsNullOrWhiteSpace(path))
562
+ {
563
+ if (path.StartsWith(Application.dataPath))
564
+ {
565
+ path = "Assets" + path.Substring(Application.dataPath.Length);
566
+ }
567
+
568
+ string dir = Path.GetDirectoryName(path);
569
+ if (!string.IsNullOrWhiteSpace(dir))
570
+ {
571
+ RecordLastAnimationDirectory(dir);
572
+ }
573
+
574
+ AnimationClip clip = AssetDatabase.LoadAssetAtPath<AnimationClip>(path);
575
+ if (clip != null)
576
+ {
577
+ AddEditorLayer(clip);
578
+ }
579
+ }
580
+ }
581
+
582
+ private static string GetLastAnimationDirectory()
583
+ {
584
+ try
585
+ {
586
+ PersistentDirectorySettings settings = PersistentDirectorySettings.Instance;
587
+ DirectoryUsageData[] paths =
588
+ settings != null
589
+ ? settings.GetPaths(DirToolName, DirContextKey, topOnly: true, topN: 1)
590
+ : Array.Empty<DirectoryUsageData>();
591
+ string candidate = paths is { Length: > 0 } ? paths[0]?.path : null;
592
+
593
+ if (string.IsNullOrWhiteSpace(candidate))
594
+ {
595
+ return "Assets";
596
+ }
597
+
598
+ // Prefer Assets-relative paths for UI components that expect them
599
+ if (!candidate.StartsWith("Assets", StringComparison.OrdinalIgnoreCase))
600
+ {
601
+ string assetsRoot = Application.dataPath.Replace('\\', '/');
602
+ string full = candidate.Replace('\\', '/');
603
+ if (full.StartsWith(assetsRoot, StringComparison.OrdinalIgnoreCase))
604
+ {
605
+ candidate = "Assets" + full.Substring(assetsRoot.Length);
606
+ }
607
+ }
608
+
609
+ return string.IsNullOrWhiteSpace(candidate) ? "Assets" : candidate;
610
+ }
611
+ catch
612
+ {
613
+ return "Assets";
614
+ }
615
+ }
616
+
617
+ private static void RecordLastAnimationDirectory(string assetsRelativeDir)
618
+ {
619
+ if (string.IsNullOrWhiteSpace(assetsRelativeDir))
620
+ {
621
+ return;
622
+ }
623
+
624
+ // Ensure Assets-relative if possible
625
+ string path = assetsRelativeDir.Replace('\\', '/');
626
+ if (!path.StartsWith("Assets", StringComparison.OrdinalIgnoreCase))
627
+ {
628
+ string assetsRoot = Application.dataPath.Replace('\\', '/');
629
+ string full = path;
630
+ if (full.StartsWith(assetsRoot, StringComparison.OrdinalIgnoreCase))
631
+ {
632
+ path = "Assets" + full.Substring(assetsRoot.Length);
633
+ }
634
+ }
635
+
636
+ PersistentDirectorySettings settings = PersistentDirectorySettings.Instance;
637
+ if (settings != null)
638
+ {
639
+ settings.RecordPath(DirToolName, DirContextKey, path);
640
+ }
641
+ }
642
+
643
+ private void AddEditorLayer(AnimationClip clip)
644
+ {
645
+ bool exists = false;
646
+ for (int i = 0; i < _loadedEditorLayers.Count; i++)
647
+ {
648
+ if (_loadedEditorLayers[i]?.SourceClip == clip)
649
+ {
650
+ exists = true;
651
+ break;
652
+ }
653
+ }
654
+ if (clip == null || exists)
655
+ {
656
+ string clipName = clip != null ? clip.name : "<null>";
657
+ this.LogWarn($"Clip '{clipName}' is null or already loaded.");
658
+ return;
659
+ }
660
+
661
+ EditorLayerData newEditorLayer = new(clip);
662
+ _loadedEditorLayers.Add(newEditorLayer);
663
+
664
+ if (_activeEditorLayer == null && newEditorLayer.Sprites.Count > 0)
665
+ {
666
+ SetActiveEditorLayer(newEditorLayer);
667
+ }
668
+ else if (_activeEditorLayer == null)
669
+ {
670
+ SetActiveEditorLayer(newEditorLayer);
671
+ }
672
+
673
+ RebuildLoadedClipsUI();
674
+ RecreatePreviewImage();
675
+ }
676
+
677
+ private void RemoveEditorLayer(EditorLayerData layerToRemove)
678
+ {
679
+ if (layerToRemove == null)
680
+ {
681
+ return;
682
+ }
683
+
684
+ _loadedEditorLayers.Remove(layerToRemove);
685
+
686
+ if (_activeEditorLayer == layerToRemove)
687
+ {
688
+ SetActiveEditorLayer(_loadedEditorLayers.Count > 0 ? _loadedEditorLayers[0] : null);
689
+ }
690
+
691
+ RebuildLoadedClipsUI();
692
+ RecreatePreviewImage();
693
+ }
694
+
695
+ private void SetActiveEditorLayer(EditorLayerData layer)
696
+ {
697
+ _activeEditorLayer = layer;
698
+ _framesContainer.Clear();
699
+ _fpsDebugLabel.text = "Detected FPS Info (Active Clip):";
700
+
701
+ if (_activeEditorLayer != null)
702
+ {
703
+ UpdateFpsDebugLabelForActiveLayer();
704
+ _saveClipButton.SetEnabled(_activeEditorLayer.SourceClip != null);
705
+ }
706
+ else
707
+ {
708
+ _saveClipButton.SetEnabled(false);
709
+ }
710
+
711
+ RebuildFramesListUI();
712
+ RebuildLoadedClipsUI();
713
+ UpdateFramesPanelTitle();
714
+ }
715
+
716
+ private void UpdateFramesPanelTitle()
717
+ {
718
+ _framesPanelTitle.text =
719
+ _activeEditorLayer != null
720
+ ? $"Frames (Editing: {_activeEditorLayer.ClipName})"
721
+ : "Frames (No Active Clip Selected)";
722
+ }
723
+
724
+ private void RebuildLoadedClipsUI()
725
+ {
726
+ _loadedClipsContainer.Clear();
727
+ if (_loadedClipDropPlaceholder.parent == _loadedClipsContainer)
728
+ {
729
+ _loadedClipsContainer.Remove(_loadedClipDropPlaceholder);
730
+ }
731
+
732
+ for (int i = 0; i < _loadedEditorLayers.Count; i++)
733
+ {
734
+ EditorLayerData editorLayer = _loadedEditorLayers[i];
735
+
736
+ VisualElement itemElement = new();
737
+ itemElement.AddToClassList("loaded-clip-item");
738
+ if (editorLayer == _activeEditorLayer)
739
+ {
740
+ itemElement.AddToClassList("loaded-clip-item--active");
741
+ }
742
+ itemElement.userData = i;
743
+
744
+ Label label = new(editorLayer.ClipName);
745
+ itemElement.Add(label);
746
+
747
+ Button removeButton = new(() => RemoveEditorLayer(editorLayer)) { text = "X" };
748
+ itemElement.Add(removeButton);
749
+
750
+ itemElement.RegisterCallback<PointerDownEvent>(evt =>
751
+ {
752
+ if (evt.button == 0 && _draggedLoadedClipElement == null)
753
+ {
754
+ SetActiveEditorLayer(editorLayer);
755
+ }
756
+ });
757
+
758
+ int currentIndex = i;
759
+ itemElement.RegisterCallback<PointerDownEvent>(evt =>
760
+ OnLoadedClipItemPointerDownSetup(evt, itemElement, currentIndex)
761
+ );
762
+ itemElement.RegisterCallback<PointerMoveEvent>(OnLoadedClipItemPointerMove);
763
+ itemElement.RegisterCallback<PointerUpEvent>(evt =>
764
+ OnLoadedClipItemPointerUpForClick(evt, itemElement, currentIndex)
765
+ );
766
+
767
+ _loadedClipsContainer.Add(itemElement);
768
+ }
769
+ }
770
+
771
+ private void OnLoadedClipItemPointerDownSetup(
772
+ PointerDownEvent evt,
773
+ VisualElement clipElement,
774
+ int originalListIndex
775
+ )
776
+ {
777
+ if (evt.button != 0 || _draggedLoadedClipElement != null || _isClipDragPending)
778
+ {
779
+ return;
780
+ }
781
+
782
+ _isClipDragPending = true;
783
+ _clipDragPendingElement = clipElement;
784
+ _clipDragPendingOriginalIndex = originalListIndex;
785
+ _clipDragStartPosition = evt.position;
786
+
787
+ clipElement.CapturePointer(evt.pointerId);
788
+
789
+ evt.StopPropagation();
790
+ }
791
+
792
+ private void OnLoadedClipItemPointerMove(PointerMoveEvent evt)
793
+ {
794
+ if (!_isClipDragPending)
795
+ {
796
+ return;
797
+ }
798
+
799
+ float diffSqrMagnitude = (evt.position - _clipDragStartPosition).sqrMagnitude;
800
+
801
+ if (diffSqrMagnitude >= DragThresholdSqrMagnitude)
802
+ {
803
+ _draggedLoadedClipElement = _clipDragPendingElement;
804
+ _draggedLoadedClipOriginalIndex = _clipDragPendingOriginalIndex;
805
+
806
+ _draggedLoadedClipElement.AddToClassList("frame-item-dragged");
807
+
808
+ DragAndDrop.PrepareStartDrag();
809
+ DragAndDrop.SetGenericData(
810
+ "DraggedLoadedClipIndex",
811
+ _draggedLoadedClipOriginalIndex
812
+ );
813
+ Object dragContextObject = _loadedEditorLayers[
814
+ _draggedLoadedClipOriginalIndex
815
+ ]?.SourceClip;
816
+ if (dragContextObject == null)
817
+ {
818
+ dragContextObject = CreateInstance<ScriptableObject>();
819
+ }
820
+ DragAndDrop.objectReferences = new[] { dragContextObject };
821
+ DragAndDrop.StartDrag(
822
+ _loadedEditorLayers[_draggedLoadedClipOriginalIndex].ClipName
823
+ ?? "Dragging Layer"
824
+ );
825
+
826
+ _isClipDragPending = false;
827
+ }
828
+ }
829
+
830
+ private void OnLoadedClipItemPointerUpForClick(
831
+ PointerUpEvent evt,
832
+ VisualElement clipElement,
833
+ int listIndex
834
+ )
835
+ {
836
+ if (evt.button != 0)
837
+ {
838
+ return;
839
+ }
840
+
841
+ if (clipElement.HasPointerCapture(evt.pointerId))
842
+ {
843
+ clipElement.ReleasePointer(evt.pointerId);
844
+ }
845
+ if (_isClipDragPending)
846
+ {
847
+ if (listIndex >= 0 && listIndex < _loadedEditorLayers.Count)
848
+ {
849
+ SetActiveEditorLayer(_loadedEditorLayers[listIndex]);
850
+ }
851
+ _isClipDragPending = false;
852
+ _clipDragPendingElement = null;
853
+ evt.StopPropagation();
854
+ }
855
+ else if (_draggedLoadedClipElement == _clipDragPendingElement)
856
+ {
857
+ if (DragAndDrop.GetGenericData("DraggedLoadedClipIndex") != null)
858
+ {
859
+ CleanupLoadedClipDragState(evt.pointerId);
860
+ }
861
+ evt.StopPropagation();
862
+ }
863
+
864
+ _isClipDragPending = false;
865
+ _clipDragPendingElement = null;
866
+ }
867
+
868
+ private void OnDraggedLoadedClipItemPointerUp(PointerUpEvent evt)
869
+ {
870
+ if (_draggedLoadedClipElement == null || evt.currentTarget != _draggedLoadedClipElement)
871
+ {
872
+ return;
873
+ }
874
+
875
+ if (
876
+ DragAndDrop.GetGenericData("DraggedLoadedClipIndex") != null
877
+ || _draggedLoadedClipElement != null
878
+ && _draggedLoadedClipElement.HasPointerCapture(evt.pointerId)
879
+ )
880
+ {
881
+ CleanupLoadedClipDragState(evt.pointerId);
882
+ }
883
+
884
+ evt.StopPropagation();
885
+ }
886
+
887
+ private void OnLoadedClipsContainerDragUpdated(DragUpdatedEvent evt)
888
+ {
889
+ object draggedIndexData = DragAndDrop.GetGenericData("DraggedLoadedClipIndex");
890
+ if (draggedIndexData != null && _draggedLoadedClipElement != null)
891
+ {
892
+ DragAndDrop.visualMode = DragAndDropVisualMode.Move;
893
+ float mouseY = evt.localMousePosition.y;
894
+ int newVisualIndex = -1;
895
+
896
+ if (_loadedClipDropPlaceholder.parent == _loadedClipsContainer)
897
+ {
898
+ _loadedClipsContainer.Remove(_loadedClipDropPlaceholder);
899
+ }
900
+
901
+ for (int i = 0; i < _loadedClipsContainer.childCount; i++)
902
+ {
903
+ VisualElement child = _loadedClipsContainer[i];
904
+ if (child == _draggedLoadedClipElement)
905
+ {
906
+ continue;
907
+ }
908
+
909
+ float childMidY = child.layout.yMin + child.layout.height / 2f;
910
+ if (mouseY < childMidY)
911
+ {
912
+ newVisualIndex = i;
913
+ break;
914
+ }
915
+ }
916
+ if (
917
+ newVisualIndex < 0
918
+ && _loadedClipsContainer.childCount > 0
919
+ && _draggedLoadedClipElement
920
+ != _loadedClipsContainer.ElementAt(_loadedClipsContainer.childCount - 1)
921
+ )
922
+ {
923
+ newVisualIndex = _loadedClipsContainer.childCount;
924
+ }
925
+
926
+ if (0 <= newVisualIndex)
927
+ {
928
+ _loadedClipsContainer.Insert(newVisualIndex, _loadedClipDropPlaceholder);
929
+ _loadedClipDropPlaceholder.style.visibility = Visibility.Visible;
930
+ }
931
+ else if (_loadedClipsContainer.childCount == 0 && _draggedLoadedClipElement != null)
932
+ {
933
+ _loadedClipsContainer.Add(_loadedClipDropPlaceholder);
934
+ _loadedClipDropPlaceholder.style.visibility = Visibility.Visible;
935
+ }
936
+ else
937
+ {
938
+ if (_loadedClipDropPlaceholder.parent == _loadedClipsContainer)
939
+ {
940
+ _loadedClipsContainer.Remove(_loadedClipDropPlaceholder);
941
+ }
942
+
943
+ _loadedClipDropPlaceholder.style.visibility = Visibility.Hidden;
944
+ }
945
+ }
946
+ else
947
+ {
948
+ DragAndDrop.visualMode = DragAndDropVisualMode.Rejected;
949
+ }
950
+ evt.StopPropagation();
951
+ }
952
+
953
+ private void OnLoadedClipsContainerDragPerform(DragPerformEvent evt)
954
+ {
955
+ object draggedIndexData = DragAndDrop.GetGenericData("DraggedLoadedClipIndex");
956
+ if (draggedIndexData != null && _draggedLoadedClipElement != null)
957
+ {
958
+ int originalListIndex = (int)draggedIndexData;
959
+
960
+ if (originalListIndex < 0 || originalListIndex >= _loadedEditorLayers.Count)
961
+ {
962
+ this.LogError(
963
+ $"DragPerform (LoadedClips): Stale or invalid dragged index. Aborting drop."
964
+ );
965
+ CleanupLoadedClipDragState(InvalidPointerId);
966
+ evt.StopPropagation();
967
+ return;
968
+ }
969
+
970
+ EditorLayerData movedLayer = _loadedEditorLayers[originalListIndex];
971
+ _loadedEditorLayers.RemoveAt(originalListIndex);
972
+
973
+ int placeholderVisualIndex = _loadedClipsContainer.IndexOf(
974
+ _loadedClipDropPlaceholder
975
+ );
976
+ int targetListIndex;
977
+
978
+ if (0 <= placeholderVisualIndex)
979
+ {
980
+ int itemsBeforePlaceholder = -1;
981
+ for (int i = 0; i < placeholderVisualIndex; i++)
982
+ {
983
+ if (_loadedClipsContainer[i] != _loadedClipDropPlaceholder)
984
+ {
985
+ itemsBeforePlaceholder++;
986
+ }
987
+ else
988
+ {
989
+ break;
990
+ }
991
+ }
992
+ targetListIndex = itemsBeforePlaceholder;
993
+ }
994
+ else
995
+ {
996
+ targetListIndex = _loadedEditorLayers.Count;
997
+ }
998
+ targetListIndex = Mathf.Clamp(targetListIndex, 0, _loadedEditorLayers.Count);
999
+ _loadedEditorLayers.Insert(targetListIndex, movedLayer);
1000
+
1001
+ DragAndDrop.AcceptDrag();
1002
+ CleanupLoadedClipDragState(InvalidPointerId);
1003
+
1004
+ RebuildLoadedClipsUI();
1005
+ RecreatePreviewImage();
1006
+ }
1007
+ else
1008
+ {
1009
+ if (DragAndDrop.GetGenericData("DraggedLoadedClipIndex") != null)
1010
+ {
1011
+ CleanupLoadedClipDragState(InvalidPointerId);
1012
+ }
1013
+ }
1014
+ evt.StopPropagation();
1015
+ }
1016
+
1017
+ private void OnLoadedClipsContainerDragLeave(DragLeaveEvent evt)
1018
+ {
1019
+ if (evt.target == _loadedClipsContainer)
1020
+ {
1021
+ if (_loadedClipDropPlaceholder.parent == _loadedClipsContainer)
1022
+ {
1023
+ _loadedClipsContainer.Remove(_loadedClipDropPlaceholder);
1024
+ }
1025
+
1026
+ if (_loadedClipDropPlaceholder != null)
1027
+ {
1028
+ _loadedClipDropPlaceholder.style.visibility = Visibility.Hidden;
1029
+ }
1030
+ }
1031
+ }
1032
+
1033
+ private void CleanupLoadedClipDragState(int pointerIdToRelease)
1034
+ {
1035
+ if (_draggedLoadedClipElement != null)
1036
+ {
1037
+ if (
1038
+ pointerIdToRelease != InvalidPointerId
1039
+ && _draggedLoadedClipElement.HasPointerCapture(pointerIdToRelease)
1040
+ )
1041
+ {
1042
+ _draggedLoadedClipElement.ReleasePointer(pointerIdToRelease);
1043
+ }
1044
+
1045
+ _draggedLoadedClipElement.UnregisterCallback<PointerUpEvent>(
1046
+ OnDraggedLoadedClipItemPointerUp
1047
+ );
1048
+
1049
+ _draggedLoadedClipElement.RemoveFromClassList("frame-item-dragged");
1050
+ _draggedLoadedClipElement = null;
1051
+ }
1052
+ _draggedLoadedClipOriginalIndex = -1;
1053
+
1054
+ _isClipDragPending = false;
1055
+ if (_clipDragPendingElement != null)
1056
+ {
1057
+ if (
1058
+ pointerIdToRelease != InvalidPointerId
1059
+ && _clipDragPendingElement.HasPointerCapture(pointerIdToRelease)
1060
+ )
1061
+ {
1062
+ _clipDragPendingElement.ReleasePointer(pointerIdToRelease);
1063
+ }
1064
+
1065
+ _clipDragPendingElement = null;
1066
+ }
1067
+
1068
+ if (_loadedClipDropPlaceholder != null)
1069
+ {
1070
+ if (_loadedClipDropPlaceholder.parent == _loadedClipsContainer)
1071
+ {
1072
+ _loadedClipsContainer.Remove(_loadedClipDropPlaceholder);
1073
+ }
1074
+
1075
+ _loadedClipDropPlaceholder.style.visibility = Visibility.Hidden;
1076
+ }
1077
+ DragAndDrop.SetGenericData("DraggedLoadedClipIndex", null);
1078
+ }
1079
+
1080
+ private void RecreatePreviewImage()
1081
+ {
1082
+ if (_animationPreview != null)
1083
+ {
1084
+ if (_animationPreview.parent == _previewPanelHost)
1085
+ {
1086
+ _previewPanelHost.Remove(_animationPreview);
1087
+ }
1088
+
1089
+ _animationPreview = null;
1090
+ }
1091
+
1092
+ if (_previewPanelHost == null)
1093
+ {
1094
+ return;
1095
+ }
1096
+
1097
+ List<AnimatedSpriteLayer> animatedSpriteLayers = new();
1098
+ if (_loadedEditorLayers.Count > 0)
1099
+ {
1100
+ foreach (EditorLayerData editorLayer in _loadedEditorLayers)
1101
+ {
1102
+ animatedSpriteLayers.Add(new AnimatedSpriteLayer(editorLayer.Sprites));
1103
+ }
1104
+ }
1105
+
1106
+ _animationPreview = new LayeredImage(
1107
+ animatedSpriteLayers,
1108
+ Color.clear,
1109
+ _currentPreviewFps,
1110
+ updatesSelf: false
1111
+ )
1112
+ {
1113
+ name = "animationPreviewElement",
1114
+ };
1115
+
1116
+ _previewPanelHost.Add(_animationPreview);
1117
+ }
1118
+
1119
+ private void OnFramesContainerDragUpdated(DragUpdatedEvent evt)
1120
+ {
1121
+ object draggedIndexData = DragAndDrop.GetGenericData("DraggedFrameDataIndex");
1122
+ if (draggedIndexData != null && _draggedFrameElement != null)
1123
+ {
1124
+ DragAndDrop.visualMode = DragAndDropVisualMode.Move;
1125
+ float mouseY = evt.localMousePosition.y;
1126
+ int newVisualIndex = -1;
1127
+
1128
+ if (_frameDropPlaceholder.parent == _framesContainer)
1129
+ {
1130
+ _framesContainer.Remove(_frameDropPlaceholder);
1131
+ }
1132
+
1133
+ for (int i = 0; i < _framesContainer.childCount; i++)
1134
+ {
1135
+ VisualElement child = _framesContainer[i];
1136
+ if (child == _draggedFrameElement)
1137
+ {
1138
+ continue;
1139
+ }
1140
+
1141
+ float childMidY = child.layout.yMin + child.layout.height / 2f;
1142
+ if (mouseY < childMidY)
1143
+ {
1144
+ newVisualIndex = i;
1145
+ break;
1146
+ }
1147
+ }
1148
+ if (
1149
+ newVisualIndex < 0
1150
+ && _framesContainer.childCount > 0
1151
+ && _draggedFrameElement
1152
+ != _framesContainer.ElementAt(_framesContainer.childCount - 1)
1153
+ )
1154
+ {
1155
+ newVisualIndex = _framesContainer.childCount;
1156
+ }
1157
+
1158
+ if (0 <= newVisualIndex)
1159
+ {
1160
+ _framesContainer.Insert(newVisualIndex, _frameDropPlaceholder);
1161
+ _frameDropPlaceholder.style.visibility = Visibility.Visible;
1162
+ }
1163
+ else if (_framesContainer.childCount == 0 && _draggedFrameElement != null)
1164
+ {
1165
+ _framesContainer.Add(_frameDropPlaceholder);
1166
+ _frameDropPlaceholder.style.visibility = Visibility.Visible;
1167
+ }
1168
+ else
1169
+ {
1170
+ if (_frameDropPlaceholder.parent == _framesContainer)
1171
+ {
1172
+ _framesContainer.Remove(_frameDropPlaceholder);
1173
+ }
1174
+
1175
+ _frameDropPlaceholder.style.visibility = Visibility.Hidden;
1176
+ }
1177
+ }
1178
+ else
1179
+ {
1180
+ DragAndDrop.visualMode = DragAndDropVisualMode.Rejected;
1181
+ }
1182
+ evt.StopPropagation();
1183
+ }
1184
+
1185
+ private void OnFramesContainerDragPerform(DragPerformEvent evt)
1186
+ {
1187
+ object draggedIndexData = DragAndDrop.GetGenericData("DraggedFrameDataIndex");
1188
+ if (
1189
+ draggedIndexData != null
1190
+ && _draggedFrameElement != null
1191
+ && _activeEditorLayer != null
1192
+ )
1193
+ {
1194
+ int originalDataIndex = (int)draggedIndexData;
1195
+
1196
+ if (originalDataIndex < 0 || originalDataIndex >= _activeEditorLayer.Sprites.Count)
1197
+ {
1198
+ this.LogError(
1199
+ $"DragPerform (Frames): Stale or invalid dragged index. Aborting drop."
1200
+ );
1201
+ CleanupFrameDragState(InvalidPointerId);
1202
+ evt.StopPropagation();
1203
+ return;
1204
+ }
1205
+
1206
+ Sprite movedSprite = _activeEditorLayer.Sprites[originalDataIndex];
1207
+ _activeEditorLayer.Sprites.RemoveAt(originalDataIndex);
1208
+
1209
+ int placeholderVisualIndex = _framesContainer.IndexOf(_frameDropPlaceholder);
1210
+ int targetDataIndex;
1211
+
1212
+ if (0 <= placeholderVisualIndex)
1213
+ {
1214
+ int itemsBeforePlaceholder = 0;
1215
+ for (int i = 0; i < placeholderVisualIndex; i++)
1216
+ {
1217
+ if (
1218
+ _framesContainer[i] != _draggedFrameElement
1219
+ && _framesContainer[i] != _frameDropPlaceholder
1220
+ )
1221
+ {
1222
+ itemsBeforePlaceholder++;
1223
+ }
1224
+ }
1225
+ targetDataIndex = itemsBeforePlaceholder;
1226
+ }
1227
+ else
1228
+ {
1229
+ targetDataIndex = _activeEditorLayer.Sprites.Count;
1230
+ }
1231
+ targetDataIndex = Mathf.Clamp(targetDataIndex, 0, _activeEditorLayer.Sprites.Count);
1232
+ _activeEditorLayer.Sprites.Insert(targetDataIndex, movedSprite);
1233
+
1234
+ DragAndDrop.AcceptDrag();
1235
+ CleanupFrameDragState(InvalidPointerId);
1236
+
1237
+ RebuildFramesListUI();
1238
+ RecreatePreviewImage();
1239
+ }
1240
+ else
1241
+ {
1242
+ if (DragAndDrop.GetGenericData("DraggedFrameDataIndex") != null)
1243
+ {
1244
+ CleanupFrameDragState(InvalidPointerId);
1245
+ }
1246
+ }
1247
+ evt.StopPropagation();
1248
+ }
1249
+
1250
+ private void OnFramesContainerDragLeave(DragLeaveEvent evt)
1251
+ {
1252
+ if (evt.target == _framesContainer)
1253
+ {
1254
+ if (_frameDropPlaceholder.parent == _framesContainer)
1255
+ {
1256
+ _framesContainer.Remove(_frameDropPlaceholder);
1257
+ }
1258
+
1259
+ if (_frameDropPlaceholder != null)
1260
+ {
1261
+ _frameDropPlaceholder.style.visibility = Visibility.Hidden;
1262
+ }
1263
+ }
1264
+
1265
+ CleanupFrameDragState(InvalidPointerId);
1266
+ }
1267
+
1268
+ private void CleanupFrameDragState(int pointerIdToRelease)
1269
+ {
1270
+ this.Log($"Cleaning up frame drag state with pointer {pointerIdToRelease}");
1271
+ if (_draggedFrameElement != null)
1272
+ {
1273
+ if (
1274
+ pointerIdToRelease != InvalidPointerId
1275
+ && _draggedFrameElement.HasPointerCapture(pointerIdToRelease)
1276
+ )
1277
+ {
1278
+ _draggedFrameElement.ReleasePointer(pointerIdToRelease);
1279
+ }
1280
+
1281
+ _draggedFrameElement.UnregisterCallback<PointerUpEvent>(
1282
+ OnDraggedFrameItemPointerUp
1283
+ );
1284
+ _draggedFrameElement.RemoveFromClassList("frame-item-dragged");
1285
+ _draggedFrameElement = null;
1286
+ }
1287
+ _draggedFrameOriginalDataIndex = -1;
1288
+
1289
+ if (_frameDropPlaceholder != null)
1290
+ {
1291
+ if (_frameDropPlaceholder.parent == _framesContainer)
1292
+ {
1293
+ _framesContainer.Remove(_frameDropPlaceholder);
1294
+ }
1295
+
1296
+ _frameDropPlaceholder.style.visibility = Visibility.Hidden;
1297
+ }
1298
+ DragAndDrop.SetGenericData("DraggedFrameDataIndex", null);
1299
+ }
1300
+
1301
+ private void UpdateFpsDebugLabelForActiveLayer()
1302
+ {
1303
+ if (_activeEditorLayer == null)
1304
+ {
1305
+ _fpsDebugLabel.text = "Detected FPS Info: No active clip.";
1306
+ return;
1307
+ }
1308
+
1309
+ _fpsDebugLabel.text =
1310
+ $"Active Clip FPS (Original): {FormatFps(_activeEditorLayer.OriginalClipFps)}fps. Preview uses global FPS.";
1311
+ }
1312
+
1313
+ private static string FormatFps(float fps)
1314
+ {
1315
+ return fps.ToString("F1");
1316
+ }
1317
+
1318
+ private void RebuildFramesListUI()
1319
+ {
1320
+ _framesContainer.Clear();
1321
+
1322
+ if (_frameDropPlaceholder != null && _frameDropPlaceholder.parent == _framesContainer)
1323
+ {
1324
+ _framesContainer.Remove(_frameDropPlaceholder);
1325
+ }
1326
+
1327
+ if (_activeEditorLayer?.Sprites == null)
1328
+ {
1329
+ return;
1330
+ }
1331
+
1332
+ for (int i = 0; i < _activeEditorLayer.Sprites.Count; i++)
1333
+ {
1334
+ Sprite sprite = _activeEditorLayer.Sprites[i];
1335
+
1336
+ VisualElement frameElement = new();
1337
+ frameElement.AddToClassList("frame-item");
1338
+
1339
+ Image frameImage = new() { sprite = sprite, scaleMode = ScaleMode.ScaleToFit };
1340
+ frameImage.AddToClassList("frame-image");
1341
+ frameElement.Add(frameImage);
1342
+
1343
+ VisualElement frameInfo = new();
1344
+ frameInfo.AddToClassList("frame-info");
1345
+ frameInfo.Add(new Label($"Frame: {i + 1}"));
1346
+ frameInfo.Add(new Label($"Sprite: {(sprite != null ? sprite.name : "(None)")}"));
1347
+ frameElement.Add(frameInfo);
1348
+
1349
+ IntegerField indexField = new(null) { value = i + 1 };
1350
+ indexField.AddToClassList("frame-index-field");
1351
+ frameElement.Add(indexField);
1352
+
1353
+ VisualElement orderFieldContainer = new()
1354
+ {
1355
+ style =
1356
+ {
1357
+ flexDirection = FlexDirection.Row,
1358
+ alignItems = Align.Center,
1359
+ marginLeft = StyleKeyword.Auto,
1360
+ },
1361
+ };
1362
+
1363
+ Label orderLabel = new("Order:") { style = { marginRight = 3 } };
1364
+ orderFieldContainer.Add(orderLabel);
1365
+ orderFieldContainer.Add(indexField);
1366
+ frameElement.Add(orderFieldContainer);
1367
+
1368
+ int currentDataIndex = i;
1369
+ frameElement.RegisterCallback<PointerDownEvent>(evt =>
1370
+ OnFrameItemPointerDown(evt, frameElement, currentDataIndex)
1371
+ );
1372
+
1373
+ indexField.userData = currentDataIndex;
1374
+
1375
+ indexField.RegisterCallback<FocusInEvent>(_ =>
1376
+ {
1377
+ CleanupFrameDragState(InvalidPointerId);
1378
+ CleanupLoadedClipDragState(InvalidPointerId);
1379
+ });
1380
+
1381
+ indexField.RegisterCallback<FocusOutEvent>(_ =>
1382
+ OnFrameIndexFieldChanged(indexField)
1383
+ );
1384
+ indexField.RegisterCallback<KeyDownEvent>(evt =>
1385
+ {
1386
+ if (evt.keyCode is KeyCode.Return or KeyCode.KeypadEnter)
1387
+ {
1388
+ OnFrameIndexFieldChanged(indexField);
1389
+ indexField.Blur();
1390
+ }
1391
+ });
1392
+
1393
+ _framesContainer.Add(frameElement);
1394
+ }
1395
+ }
1396
+
1397
+ private void OnFrameIndexFieldChanged(IntegerField field)
1398
+ {
1399
+ CleanupFrameDragState(InvalidPointerId);
1400
+ CleanupLoadedClipDragState(InvalidPointerId);
1401
+ if (_activeEditorLayer?.Sprites == null)
1402
+ {
1403
+ return;
1404
+ }
1405
+
1406
+ int originalDataIndex = (int)field.userData;
1407
+ int newUiIndex = field.value;
1408
+ int newRequestedDataIndex = newUiIndex - 1;
1409
+ int newClampedDataIndex = Mathf.Clamp(
1410
+ newRequestedDataIndex,
1411
+ 0,
1412
+ _activeEditorLayer.Sprites.Count - 1
1413
+ );
1414
+
1415
+ if (newClampedDataIndex != originalDataIndex)
1416
+ {
1417
+ if (originalDataIndex < 0 || originalDataIndex >= _activeEditorLayer.Sprites.Count)
1418
+ {
1419
+ this.LogWarn(
1420
+ $"Original index {originalDataIndex} out of bounds. Rebuilding UI to correct."
1421
+ );
1422
+ RebuildFramesListUI();
1423
+ return;
1424
+ }
1425
+ Sprite spriteToMove = _activeEditorLayer.Sprites[originalDataIndex];
1426
+ _activeEditorLayer.Sprites.RemoveAt(originalDataIndex);
1427
+ _activeEditorLayer.Sprites.Insert(newClampedDataIndex, spriteToMove);
1428
+ RebuildFramesListUI();
1429
+ RecreatePreviewImage();
1430
+ }
1431
+ else if (newUiIndex - 1 != newClampedDataIndex)
1432
+ {
1433
+ RebuildFramesListUI();
1434
+ }
1435
+ }
1436
+
1437
+ private void OnFrameItemPointerDown(
1438
+ PointerDownEvent evt,
1439
+ VisualElement frameElement,
1440
+ int originalDataIndex
1441
+ )
1442
+ {
1443
+ if (evt.button != 0 || _draggedFrameElement != null)
1444
+ {
1445
+ return;
1446
+ }
1447
+
1448
+ if (
1449
+ _activeEditorLayer == null
1450
+ || originalDataIndex < 0
1451
+ || originalDataIndex >= _activeEditorLayer.Sprites.Count
1452
+ )
1453
+ {
1454
+ this.LogError(
1455
+ $"OnFrameItemPointerDown: Invalid originalDataIndex ({originalDataIndex}) or no active layer. Sprite count: {_activeEditorLayer?.Sprites?.Count ?? -1}"
1456
+ );
1457
+ return;
1458
+ }
1459
+
1460
+ _draggedFrameElement = frameElement;
1461
+ _draggedFrameOriginalDataIndex = originalDataIndex;
1462
+
1463
+ try
1464
+ {
1465
+ _draggedFrameElement.RegisterCallback<PointerUpEvent>(OnDraggedFrameItemPointerUp);
1466
+ _draggedFrameElement.AddToClassList("frame-item-dragged");
1467
+
1468
+ DragAndDrop.PrepareStartDrag();
1469
+ DragAndDrop.SetGenericData("DraggedFrameDataIndex", _draggedFrameOriginalDataIndex);
1470
+
1471
+ Object dragContextObject = _activeEditorLayer.SourceClip;
1472
+ if (dragContextObject == null)
1473
+ {
1474
+ dragContextObject = CreateInstance<ScriptableObject>();
1475
+ }
1476
+ if (dragContextObject == null)
1477
+ {
1478
+ this.LogError($"Failed to create dragContextObject for frame drag.");
1479
+
1480
+ _draggedFrameElement.ReleasePointer(evt.pointerId);
1481
+ _draggedFrameElement.UnregisterCallback<PointerUpEvent>(
1482
+ OnDraggedFrameItemPointerUp
1483
+ );
1484
+ _draggedFrameElement.RemoveFromClassList("frame-item-dragged");
1485
+ _draggedFrameElement = null;
1486
+ return;
1487
+ }
1488
+ DragAndDrop.objectReferences = new[] { dragContextObject };
1489
+
1490
+ Sprite spriteBeingDragged = _activeEditorLayer.Sprites[originalDataIndex];
1491
+ string dragTitle;
1492
+ if (spriteBeingDragged != null)
1493
+ {
1494
+ dragTitle = !string.IsNullOrWhiteSpace(spriteBeingDragged.name)
1495
+ ? spriteBeingDragged.name
1496
+ : $"Unnamed Sprite Frame {originalDataIndex + 1}";
1497
+ }
1498
+ else
1499
+ {
1500
+ dragTitle = $"Empty Frame {originalDataIndex + 1}";
1501
+ }
1502
+
1503
+ if (string.IsNullOrWhiteSpace(dragTitle))
1504
+ {
1505
+ dragTitle = "Dragging Frame";
1506
+ }
1507
+
1508
+ DragAndDrop.StartDrag(dragTitle);
1509
+ }
1510
+ catch (Exception e)
1511
+ {
1512
+ this.LogError(
1513
+ $"Exception during OnFrameItemPointerDown before StartDrag: {e.Message}\n{e.StackTrace}"
1514
+ );
1515
+
1516
+ if (_draggedFrameElement != null)
1517
+ {
1518
+ if (_draggedFrameElement.HasPointerCapture(evt.pointerId))
1519
+ {
1520
+ _draggedFrameElement.ReleasePointer(evt.pointerId);
1521
+ }
1522
+
1523
+ _draggedFrameElement.UnregisterCallback<PointerUpEvent>(
1524
+ OnDraggedFrameItemPointerUp
1525
+ );
1526
+ _draggedFrameElement.RemoveFromClassList("frame-item-dragged");
1527
+ _draggedFrameElement = null;
1528
+ }
1529
+ _draggedFrameOriginalDataIndex = -1;
1530
+ }
1531
+ }
1532
+
1533
+ private void OnDraggedFrameItemPointerUp(PointerUpEvent evt)
1534
+ {
1535
+ if (_draggedFrameElement == null || evt.currentTarget != _draggedFrameElement)
1536
+ {
1537
+ return;
1538
+ }
1539
+
1540
+ if (DragAndDrop.GetGenericData("DraggedFrameDataIndex") != null)
1541
+ {
1542
+ CleanupFrameDragState(evt.pointerId);
1543
+ }
1544
+ else if (
1545
+ _draggedFrameElement != null
1546
+ && _draggedFrameElement.HasPointerCapture(evt.pointerId)
1547
+ )
1548
+ {
1549
+ _draggedFrameElement.ReleasePointer(evt.pointerId);
1550
+ _draggedFrameElement.UnregisterCallback<PointerUpEvent>(
1551
+ OnDraggedFrameItemPointerUp
1552
+ );
1553
+ _draggedFrameElement.RemoveFromClassList("frame-item-dragged");
1554
+ _draggedFrameElement = null;
1555
+ }
1556
+ evt.StopPropagation();
1557
+ }
1558
+
1559
+ private void OnApplyFpsToPreviewClicked()
1560
+ {
1561
+ _currentPreviewFps = Mathf.Max(0.1f, _fpsField.value);
1562
+ _fpsField.SetValueWithoutNotify(_currentPreviewFps);
1563
+ if (_animationPreview != null)
1564
+ {
1565
+ _animationPreview.Fps = _currentPreviewFps;
1566
+ }
1567
+ }
1568
+
1569
+ private void OnSaveClipClicked()
1570
+ {
1571
+ if (_activeEditorLayer == null || _activeEditorLayer.SourceClip == null)
1572
+ {
1573
+ this.LogError($"No active animation clip to save.");
1574
+ return;
1575
+ }
1576
+
1577
+ AnimationClip clipToSave = _activeEditorLayer.SourceClip;
1578
+ string bindingPath = _activeEditorLayer.BindingPath;
1579
+
1580
+ EditorCurveBinding spriteBinding = default;
1581
+ bool bindingFound = false;
1582
+ EditorCurveBinding[] allBindings = AnimationUtility.GetObjectReferenceCurveBindings(
1583
+ clipToSave
1584
+ );
1585
+
1586
+ foreach (EditorCurveBinding b in allBindings)
1587
+ {
1588
+ if (
1589
+ b.type == typeof(SpriteRenderer)
1590
+ && string.Equals(b.propertyName, "m_Sprite", StringComparison.Ordinal)
1591
+ && (
1592
+ string.IsNullOrWhiteSpace(bindingPath)
1593
+ || string.Equals(b.path, bindingPath, StringComparison.Ordinal)
1594
+ )
1595
+ )
1596
+ {
1597
+ spriteBinding = b;
1598
+ bindingFound = true;
1599
+ break;
1600
+ }
1601
+ }
1602
+
1603
+ if (!bindingFound)
1604
+ {
1605
+ foreach (EditorCurveBinding b in allBindings)
1606
+ {
1607
+ if (
1608
+ b.type == typeof(SpriteRenderer)
1609
+ && string.Equals(b.propertyName, "m_Sprite", StringComparison.Ordinal)
1610
+ )
1611
+ {
1612
+ spriteBinding = b;
1613
+ bindingFound = true;
1614
+ this.LogWarn(
1615
+ $"Saving to first available m_Sprite binding on '{clipToSave.name}' as specific path '{bindingPath}' was not found or empty."
1616
+ );
1617
+ break;
1618
+ }
1619
+ }
1620
+ }
1621
+
1622
+ if (!bindingFound)
1623
+ {
1624
+ this.LogError(
1625
+ $"Cannot save '{clipToSave.name}': No SpriteRenderer m_Sprite binding found (Path Hint: '{bindingPath}'). Clip might be empty or not a sprite animation."
1626
+ );
1627
+ return;
1628
+ }
1629
+
1630
+ List<Sprite> spritesToSave = _activeEditorLayer.Sprites;
1631
+ ObjectReferenceKeyframe[] newKeyframes = new ObjectReferenceKeyframe[
1632
+ spritesToSave.Count
1633
+ ];
1634
+ float timePerFrame = _currentPreviewFps > 0 ? 1.0f / _currentPreviewFps : 0f;
1635
+
1636
+ for (int i = 0; i < spritesToSave.Count; i++)
1637
+ {
1638
+ newKeyframes[i] = new ObjectReferenceKeyframe
1639
+ {
1640
+ time = i * timePerFrame,
1641
+ value = spritesToSave[i],
1642
+ };
1643
+ }
1644
+
1645
+ Undo.RecordObject(clipToSave, "Modify Animation Clip Frames");
1646
+ AnimationUtility.SetObjectReferenceCurve(clipToSave, spriteBinding, newKeyframes);
1647
+ clipToSave.frameRate = _currentPreviewFps;
1648
+
1649
+ EditorUtility.SetDirty(clipToSave);
1650
+ AssetDatabase.SaveAssets();
1651
+
1652
+ this.Log(
1653
+ $"Animation clip '{clipToSave.name}' saved with {spritesToSave.Count} frames at {_currentPreviewFps} FPS."
1654
+ );
1655
+ }
1656
+
1657
+ private void OnDisable()
1658
+ {
1659
+ CleanupFrameDragState(InvalidPointerId);
1660
+ CleanupLoadedClipDragState(InvalidPointerId);
1661
+
1662
+ if (_animationPreview != null && _animationPreview.parent == _previewPanelHost)
1663
+ {
1664
+ _previewPanelHost.Remove(_animationPreview);
1665
+ }
1666
+ _animationPreview = null;
1667
+ }
1668
+ }
1669
+ #endif
1670
+ }