From 30dee9978c84d52331b539f770ecd3bc760e53d4 Mon Sep 17 00:00:00 2001 From: ww-rm Date: Wed, 1 Oct 2025 16:35:51 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E9=87=8D=E6=9E=84=E5=B9=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0HitTest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TextureLoader.cs | 2 +- .../{SpineWrappers => }/V21/Animation21.cs | 4 +- .../V21/AnimationState21.cs | 10 +- .../V21/Attachments/Attachment21.cs | 6 +- .../Attachments/BoundingBoxAttachment21.cs | 8 +- .../V21/Attachments/MeshAttachment21.cs | 8 +- .../V21/Attachments/RegionAttachment21.cs | 8 +- .../Attachments/SkinnedMeshAttachment21.cs | 8 +- .../{SpineWrappers => }/V21/Bone21.cs | 4 +- .../{SpineWrappers => }/V21/Skeleton21.cs | 9 +- .../V21/SkeletonClipping21.cs | 6 +- .../{SpineWrappers => }/V21/Skin21.cs | 4 +- .../{SpineWrappers => }/V21/Slot21.cs | 7 +- .../V21/SpineObjectData21.cs | 10 +- .../{SpineWrappers => }/V21/TrackEntry21.cs | 10 +- .../{SpineWrappers => }/V34/Animation34.cs | 4 +- .../V34/AnimationState34.cs | 10 +- .../V34/Attachments/Attachment34.cs | 6 +- .../Attachments/BoundingBoxAttachment34.cs | 8 +- .../V34/Attachments/MeshAttachment34.cs | 8 +- .../V34/Attachments/PathAttachment34.cs | 8 +- .../V34/Attachments/RegionAttachment34.cs | 8 +- .../{SpineWrappers => }/V34/Bone34.cs | 4 +- .../{SpineWrappers => }/V34/Skeleton34.cs | 10 +- .../V34/SkeletonClipping34.cs | 6 +- .../{SpineWrappers => }/V34/Skin34.cs | 4 +- .../{SpineWrappers => }/V34/Slot34.cs | 7 +- .../V34/SpineObjectData34.cs | 10 +- .../{SpineWrappers => }/V34/TrackEntry34.cs | 10 +- .../{SpineWrappers => }/V35/Animation35.cs | 4 +- .../V35/AnimationState35.cs | 14 +- .../V35/Attachments/Attachment35.cs | 6 +- .../Attachments/BoundingBoxAttachment35.cs | 8 +- .../V35/Attachments/ClippingAttachment35.cs | 8 +- .../V35/Attachments/MeshAttachment35.cs | 8 +- .../V35/Attachments/PathAttachment35.cs | 8 +- .../V35/Attachments/PointAttachment35.cs | 8 +- .../V35/Attachments/RegionAttachment35.cs | 8 +- .../{SpineWrappers => }/V35/Bone35.cs | 4 +- .../{SpineWrappers => }/V35/Skeleton35.cs | 10 +- .../V35/SkeletonClipping35.cs | 6 +- .../{SpineWrappers => }/V35/Skin35.cs | 4 +- .../{SpineWrappers => }/V35/Slot35.cs | 7 +- .../V35/SpineObjectData35.cs | 10 +- .../{SpineWrappers => }/V35/TrackEntry35.cs | 14 +- .../{SpineWrappers => }/V36/Animation36.cs | 4 +- .../V36/AnimationState36.cs | 14 +- .../V36/Attachments/Attachment36.cs | 6 +- .../Attachments/BoundingBoxAttachment36.cs | 8 +- .../V36/Attachments/ClippingAttachment36.cs | 8 +- .../V36/Attachments/MeshAttachment36.cs | 8 +- .../V36/Attachments/PathAttachment36.cs | 8 +- .../V36/Attachments/PointAttachment36.cs | 8 +- .../V36/Attachments/RegionAttachment36.cs | 8 +- .../{SpineWrappers => }/V36/Bone36.cs | 4 +- .../{SpineWrappers => }/V36/Skeleton36.cs | 10 +- .../V36/SkeletonClipping36.cs | 6 +- .../{SpineWrappers => }/V36/Skin36.cs | 4 +- .../{SpineWrappers => }/V36/Slot36.cs | 7 +- .../V36/SpineObjectData36.cs | 10 +- .../{SpineWrappers => }/V36/TrackEntry36.cs | 14 +- .../{SpineWrappers => }/V37/Animation37.cs | 4 +- .../V37/AnimationState37.cs | 14 +- .../V37/Attachments/Attachment37.cs | 6 +- .../Attachments/BoundingBoxAttachment37.cs | 8 +- .../V37/Attachments/ClippingAttachment37.cs | 8 +- .../V37/Attachments/MeshAttachment37.cs | 8 +- .../V37/Attachments/PathAttachment37.cs | 8 +- .../V37/Attachments/PointAttachment37.cs | 8 +- .../V37/Attachments/RegionAttachment37.cs | 8 +- .../{SpineWrappers => }/V37/Bone37.cs | 4 +- .../{SpineWrappers => }/V37/Skeleton37.cs | 10 +- .../V37/SkeletonClipping37.cs | 6 +- .../{SpineWrappers => }/V37/Skin37.cs | 4 +- .../{SpineWrappers => }/V37/Slot37.cs | 7 +- .../V37/SpineObjectData37.cs | 10 +- .../{SpineWrappers => }/V37/TrackEntry37.cs | 14 +- .../{SpineWrappers => }/V38/Animation38.cs | 4 +- .../V38/AnimationState38.cs | 14 +- .../V38/Attachments/Attachment38.cs | 6 +- .../Attachments/BoundingBoxAttachment38.cs | 8 +- .../V38/Attachments/ClippingAttachment38.cs | 8 +- .../V38/Attachments/MeshAttachment38.cs | 8 +- .../V38/Attachments/PathAttachment38.cs | 8 +- .../V38/Attachments/PointAttachment38.cs | 8 +- .../V38/Attachments/RegionAttachment38.cs | 8 +- .../{SpineWrappers => }/V38/Bone38.cs | 4 +- .../{SpineWrappers => }/V38/Skeleton38.cs | 10 +- .../V38/SkeletonClipping38.cs | 6 +- .../{SpineWrappers => }/V38/Skin38.cs | 4 +- .../{SpineWrappers => }/V38/Slot38.cs | 7 +- .../V38/SpineObjectData38.cs | 10 +- .../{SpineWrappers => }/V38/TrackEntry38.cs | 14 +- .../{SpineWrappers => }/V40/Animation40.cs | 4 +- .../V40/AnimationState40.cs | 14 +- .../V40/Attachments/Attachment40.cs | 6 +- .../Attachments/BoundingBoxAttachment40.cs | 8 +- .../V40/Attachments/ClippingAttachment40.cs | 8 +- .../V40/Attachments/MeshAttachment40.cs | 8 +- .../V40/Attachments/PathAttachment40.cs | 8 +- .../V40/Attachments/PointAttachment40.cs | 8 +- .../V40/Attachments/RegionAttachment40.cs | 8 +- .../{SpineWrappers => }/V40/Bone40.cs | 4 +- .../{SpineWrappers => }/V40/Skeleton40.cs | 10 +- .../V40/SkeletonClipping40.cs | 6 +- .../{SpineWrappers => }/V40/Skin40.cs | 4 +- .../{SpineWrappers => }/V40/Slot40.cs | 7 +- .../V40/SpineObjectData40.cs | 10 +- .../{SpineWrappers => }/V40/TrackEntry40.cs | 14 +- .../{SpineWrappers => }/V41/Animation41.cs | 4 +- .../V41/AnimationState41.cs | 14 +- .../V41/Attachments/Attachment41.cs | 6 +- .../Attachments/BoundingBoxAttachment41.cs | 8 +- .../V41/Attachments/ClippingAttachment41.cs | 8 +- .../V41/Attachments/MeshAttachment41.cs | 8 +- .../V41/Attachments/PathAttachment41.cs | 8 +- .../V41/Attachments/PointAttachment41.cs | 8 +- .../V41/Attachments/RegionAttachment41.cs | 8 +- .../{SpineWrappers => }/V41/Bone41.cs | 4 +- .../{SpineWrappers => }/V41/Skeleton41.cs | 10 +- .../V41/SkeletonClipping41.cs | 6 +- .../{SpineWrappers => }/V41/Skin41.cs | 4 +- .../{SpineWrappers => }/V41/Slot41.cs | 7 +- .../V41/SpineObjectData41.cs | 10 +- .../{SpineWrappers => }/V41/TrackEntry41.cs | 14 +- .../{SpineWrappers => }/V42/Animation42.cs | 4 +- .../V42/AnimationState42.cs | 14 +- .../V42/Attachments/Attachment42.cs | 6 +- .../Attachments/BoundingBoxAttachment42.cs | 8 +- .../V42/Attachments/ClippingAttachment42.cs | 8 +- .../V42/Attachments/MeshAttachment42.cs | 8 +- .../V42/Attachments/PathAttachment42.cs | 8 +- .../V42/Attachments/PointAttachment42.cs | 8 +- .../V42/Attachments/RegionAttachment42.cs | 8 +- .../{SpineWrappers => }/V42/Bone42.cs | 4 +- .../{SpineWrappers => }/V42/Skeleton42.cs | 10 +- .../V42/SkeletonClipping42.cs | 6 +- .../{SpineWrappers => }/V42/Skin42.cs | 4 +- .../{SpineWrappers => }/V42/Slot42.cs | 7 +- .../V42/SpineObjectData42.cs | 10 +- .../{SpineWrappers => }/V42/TrackEntry42.cs | 14 +- .../Attachments/IAttachment.cs | 5 +- .../Attachments/IBoundingBoxAttachment.cs | 2 +- .../Attachments/IClippingAttachment.cs | 2 +- .../Attachments/IMeshAttachment.cs | 5 +- .../Attachments/IPathAttachment.cs | 2 +- .../Attachments/IPointAttachment.cs | 2 +- .../Attachments/IRegionAttachment.cs | 5 +- .../Attachments/ISkinnedMeshAttachment.cs | 5 +- .../IAnimation.cs | 2 +- .../IAnimationState.cs | 2 +- Spine/{SpineWrappers => Interfaces}/IBone.cs | 2 +- .../ISkeleton.cs | 7 +- .../ISkeletonClipping.cs | 4 +- Spine/{SpineWrappers => Interfaces}/ISkin.cs | 2 +- Spine/{SpineWrappers => Interfaces}/ISlot.cs | 5 +- .../ISpineObjectData.cs | 4 +- .../ITrackEntry.cs | 2 +- Spine/Interfaces/SpineExtension.cs | 122 ++++++++++++++++++ .../SpineObjectData.cs | 5 +- Spine/Spine.csproj | 6 - Spine/SpineObject.cs | 5 +- .../Extensions/SpineObjectExtension.cs | 1 + SpineViewer/Models/PreferenceModel.cs | 1 - SpineViewer/Models/SpineObjectConfigModel.cs | 2 +- SpineViewer/Models/SpineObjectModel.cs | 10 +- .../MainWindow/ExplorerListViewModel.cs | 1 + .../MainWindow/PreferenceViewModel.cs | 2 +- .../MainWindow/SpineObjectTabViewModel.cs | 2 +- SpineViewerCLI/SpineViewerCLI.cs | 1 + 170 files changed, 748 insertions(+), 564 deletions(-) rename Spine/{SpineWrappers => Implementations}/TextureLoader.cs (99%) rename Spine/Implementations/{SpineWrappers => }/V21/Animation21.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V21/AnimationState21.cs (94%) rename Spine/Implementations/{SpineWrappers => }/V21/Attachments/Attachment21.cs (80%) rename Spine/Implementations/{SpineWrappers => }/V21/Attachments/BoundingBoxAttachment21.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V21/Attachments/MeshAttachment21.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V21/Attachments/RegionAttachment21.cs (84%) rename Spine/Implementations/{SpineWrappers => }/V21/Attachments/SkinnedMeshAttachment21.cs (86%) rename Spine/Implementations/{SpineWrappers => }/V21/Bone21.cs (92%) rename Spine/Implementations/{SpineWrappers => }/V21/Skeleton21.cs (94%) rename Spine/Implementations/{SpineWrappers => }/V21/SkeletonClipping21.cs (90%) rename Spine/Implementations/{SpineWrappers => }/V21/Skin21.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V21/Slot21.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V21/SpineObjectData21.cs (96%) rename Spine/Implementations/{SpineWrappers => }/V21/TrackEntry21.cs (91%) rename Spine/Implementations/{SpineWrappers => }/V34/Animation34.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V34/AnimationState34.cs (94%) rename Spine/Implementations/{SpineWrappers => }/V34/Attachments/Attachment34.cs (80%) rename Spine/Implementations/{SpineWrappers => }/V34/Attachments/BoundingBoxAttachment34.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V34/Attachments/MeshAttachment34.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V34/Attachments/PathAttachment34.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V34/Attachments/RegionAttachment34.cs (84%) rename Spine/Implementations/{SpineWrappers => }/V34/Bone34.cs (92%) rename Spine/Implementations/{SpineWrappers => }/V34/Skeleton34.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V34/SkeletonClipping34.cs (90%) rename Spine/Implementations/{SpineWrappers => }/V34/Skin34.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V34/Slot34.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V34/SpineObjectData34.cs (96%) rename Spine/Implementations/{SpineWrappers => }/V34/TrackEntry34.cs (91%) rename Spine/Implementations/{SpineWrappers => }/V35/Animation35.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V35/AnimationState35.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V35/Attachments/Attachment35.cs (80%) rename Spine/Implementations/{SpineWrappers => }/V35/Attachments/BoundingBoxAttachment35.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V35/Attachments/ClippingAttachment35.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V35/Attachments/MeshAttachment35.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V35/Attachments/PathAttachment35.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V35/Attachments/PointAttachment35.cs (78%) rename Spine/Implementations/{SpineWrappers => }/V35/Attachments/RegionAttachment35.cs (84%) rename Spine/Implementations/{SpineWrappers => }/V35/Bone35.cs (92%) rename Spine/Implementations/{SpineWrappers => }/V35/Skeleton35.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V35/SkeletonClipping35.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V35/Skin35.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V35/Slot35.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V35/SpineObjectData35.cs (96%) rename Spine/Implementations/{SpineWrappers => }/V35/TrackEntry35.cs (90%) rename Spine/Implementations/{SpineWrappers => }/V36/Animation36.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V36/AnimationState36.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V36/Attachments/Attachment36.cs (80%) rename Spine/Implementations/{SpineWrappers => }/V36/Attachments/BoundingBoxAttachment36.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V36/Attachments/ClippingAttachment36.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V36/Attachments/MeshAttachment36.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V36/Attachments/PathAttachment36.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V36/Attachments/PointAttachment36.cs (78%) rename Spine/Implementations/{SpineWrappers => }/V36/Attachments/RegionAttachment36.cs (84%) rename Spine/Implementations/{SpineWrappers => }/V36/Bone36.cs (92%) rename Spine/Implementations/{SpineWrappers => }/V36/Skeleton36.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V36/SkeletonClipping36.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V36/Skin36.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V36/Slot36.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V36/SpineObjectData36.cs (96%) rename Spine/Implementations/{SpineWrappers => }/V36/TrackEntry36.cs (90%) rename Spine/Implementations/{SpineWrappers => }/V37/Animation37.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V37/AnimationState37.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V37/Attachments/Attachment37.cs (80%) rename Spine/Implementations/{SpineWrappers => }/V37/Attachments/BoundingBoxAttachment37.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V37/Attachments/ClippingAttachment37.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V37/Attachments/MeshAttachment37.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V37/Attachments/PathAttachment37.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V37/Attachments/PointAttachment37.cs (78%) rename Spine/Implementations/{SpineWrappers => }/V37/Attachments/RegionAttachment37.cs (84%) rename Spine/Implementations/{SpineWrappers => }/V37/Bone37.cs (92%) rename Spine/Implementations/{SpineWrappers => }/V37/Skeleton37.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V37/SkeletonClipping37.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V37/Skin37.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V37/Slot37.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V37/SpineObjectData37.cs (96%) rename Spine/Implementations/{SpineWrappers => }/V37/TrackEntry37.cs (90%) rename Spine/Implementations/{SpineWrappers => }/V38/Animation38.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V38/AnimationState38.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V38/Attachments/Attachment38.cs (81%) rename Spine/Implementations/{SpineWrappers => }/V38/Attachments/BoundingBoxAttachment38.cs (80%) rename Spine/Implementations/{SpineWrappers => }/V38/Attachments/ClippingAttachment38.cs (80%) rename Spine/Implementations/{SpineWrappers => }/V38/Attachments/MeshAttachment38.cs (86%) rename Spine/Implementations/{SpineWrappers => }/V38/Attachments/PathAttachment38.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V38/Attachments/PointAttachment38.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V38/Attachments/RegionAttachment38.cs (84%) rename Spine/Implementations/{SpineWrappers => }/V38/Bone38.cs (91%) rename Spine/Implementations/{SpineWrappers => }/V38/Skeleton38.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V38/SkeletonClipping38.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V38/Skin38.cs (92%) rename Spine/Implementations/{SpineWrappers => }/V38/Slot38.cs (94%) rename Spine/Implementations/{SpineWrappers => }/V38/SpineObjectData38.cs (96%) rename Spine/Implementations/{SpineWrappers => }/V38/TrackEntry38.cs (90%) rename Spine/Implementations/{SpineWrappers => }/V40/Animation40.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V40/AnimationState40.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V40/Attachments/Attachment40.cs (80%) rename Spine/Implementations/{SpineWrappers => }/V40/Attachments/BoundingBoxAttachment40.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V40/Attachments/ClippingAttachment40.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V40/Attachments/MeshAttachment40.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V40/Attachments/PathAttachment40.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V40/Attachments/PointAttachment40.cs (78%) rename Spine/Implementations/{SpineWrappers => }/V40/Attachments/RegionAttachment40.cs (84%) rename Spine/Implementations/{SpineWrappers => }/V40/Bone40.cs (91%) rename Spine/Implementations/{SpineWrappers => }/V40/Skeleton40.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V40/SkeletonClipping40.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V40/Skin40.cs (92%) rename Spine/Implementations/{SpineWrappers => }/V40/Slot40.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V40/SpineObjectData40.cs (96%) rename Spine/Implementations/{SpineWrappers => }/V40/TrackEntry40.cs (90%) rename Spine/Implementations/{SpineWrappers => }/V41/Animation41.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V41/AnimationState41.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V41/Attachments/Attachment41.cs (80%) rename Spine/Implementations/{SpineWrappers => }/V41/Attachments/BoundingBoxAttachment41.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V41/Attachments/ClippingAttachment41.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V41/Attachments/MeshAttachment41.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V41/Attachments/PathAttachment41.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V41/Attachments/PointAttachment41.cs (78%) rename Spine/Implementations/{SpineWrappers => }/V41/Attachments/RegionAttachment41.cs (84%) rename Spine/Implementations/{SpineWrappers => }/V41/Bone41.cs (91%) rename Spine/Implementations/{SpineWrappers => }/V41/Skeleton41.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V41/SkeletonClipping41.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V41/Skin41.cs (92%) rename Spine/Implementations/{SpineWrappers => }/V41/Slot41.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V41/SpineObjectData41.cs (96%) rename Spine/Implementations/{SpineWrappers => }/V41/TrackEntry41.cs (90%) rename Spine/Implementations/{SpineWrappers => }/V42/Animation42.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V42/AnimationState42.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V42/Attachments/Attachment42.cs (80%) rename Spine/Implementations/{SpineWrappers => }/V42/Attachments/BoundingBoxAttachment42.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V42/Attachments/ClippingAttachment42.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V42/Attachments/MeshAttachment42.cs (85%) rename Spine/Implementations/{SpineWrappers => }/V42/Attachments/PathAttachment42.cs (79%) rename Spine/Implementations/{SpineWrappers => }/V42/Attachments/PointAttachment42.cs (78%) rename Spine/Implementations/{SpineWrappers => }/V42/Attachments/RegionAttachment42.cs (84%) rename Spine/Implementations/{SpineWrappers => }/V42/Bone42.cs (91%) rename Spine/Implementations/{SpineWrappers => }/V42/Skeleton42.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V42/SkeletonClipping42.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V42/Skin42.cs (92%) rename Spine/Implementations/{SpineWrappers => }/V42/Slot42.cs (93%) rename Spine/Implementations/{SpineWrappers => }/V42/SpineObjectData42.cs (96%) rename Spine/Implementations/{SpineWrappers => }/V42/TrackEntry42.cs (90%) rename Spine/{SpineWrappers => Interfaces}/Attachments/IAttachment.cs (90%) rename Spine/{SpineWrappers => Interfaces}/Attachments/IBoundingBoxAttachment.cs (82%) rename Spine/{SpineWrappers => Interfaces}/Attachments/IClippingAttachment.cs (82%) rename Spine/{SpineWrappers => Interfaces}/Attachments/IMeshAttachment.cs (94%) rename Spine/{SpineWrappers => Interfaces}/Attachments/IPathAttachment.cs (81%) rename Spine/{SpineWrappers => Interfaces}/Attachments/IPointAttachment.cs (81%) rename Spine/{SpineWrappers => Interfaces}/Attachments/IRegionAttachment.cs (94%) rename Spine/{SpineWrappers => Interfaces}/Attachments/ISkinnedMeshAttachment.cs (94%) rename Spine/{SpineWrappers => Interfaces}/IAnimation.cs (92%) rename Spine/{SpineWrappers => Interfaces}/IAnimationState.cs (99%) rename Spine/{SpineWrappers => Interfaces}/IBone.cs (97%) rename Spine/{SpineWrappers => Interfaces}/ISkeleton.cs (93%) rename Spine/{SpineWrappers => Interfaces}/ISkeletonClipping.cs (95%) rename Spine/{SpineWrappers => Interfaces}/ISkin.cs (94%) rename Spine/{SpineWrappers => Interfaces}/ISlot.cs (94%) rename Spine/{SpineWrappers => Interfaces}/ISpineObjectData.cs (95%) rename Spine/{SpineWrappers => Interfaces}/ITrackEntry.cs (98%) create mode 100644 Spine/Interfaces/SpineExtension.cs rename Spine/{SpineWrappers => Interfaces}/SpineObjectData.cs (97%) diff --git a/Spine/SpineWrappers/TextureLoader.cs b/Spine/Implementations/TextureLoader.cs similarity index 99% rename from Spine/SpineWrappers/TextureLoader.cs rename to Spine/Implementations/TextureLoader.cs index 0d6b0dc..4eb8da1 100644 --- a/Spine/SpineWrappers/TextureLoader.cs +++ b/Spine/Implementations/TextureLoader.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers +namespace Spine.Implementations { /// /// 实现不同版本的 TextureLoader diff --git a/Spine/Implementations/SpineWrappers/V21/Animation21.cs b/Spine/Implementations/V21/Animation21.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V21/Animation21.cs rename to Spine/Implementations/V21/Animation21.cs index 8ce3b98..b9cc52a 100644 --- a/Spine/Implementations/SpineWrappers/V21/Animation21.cs +++ b/Spine/Implementations/V21/Animation21.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime21; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V21 +namespace Spine.Implementations.V21 { internal sealed class Animation21(Animation innerObject) : IAnimation { diff --git a/Spine/Implementations/SpineWrappers/V21/AnimationState21.cs b/Spine/Implementations/V21/AnimationState21.cs similarity index 94% rename from Spine/Implementations/SpineWrappers/V21/AnimationState21.cs rename to Spine/Implementations/V21/AnimationState21.cs index d0728f2..0b8d18a 100644 --- a/Spine/Implementations/SpineWrappers/V21/AnimationState21.cs +++ b/Spine/Implementations/V21/AnimationState21.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime21; -namespace Spine.Implementations.SpineWrappers.V21 +namespace Spine.Implementations.V21 { internal sealed class AnimationState21(AnimationState innerObject, SpineObjectData21 data) : IAnimationState { @@ -35,7 +35,7 @@ namespace Spine.Implementations.SpineWrappers.V21 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -64,7 +64,7 @@ namespace Spine.Implementations.SpineWrappers.V21 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -93,7 +93,7 @@ namespace Spine.Implementations.SpineWrappers.V21 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; diff --git a/Spine/Implementations/SpineWrappers/V21/Attachments/Attachment21.cs b/Spine/Implementations/V21/Attachments/Attachment21.cs similarity index 80% rename from Spine/Implementations/SpineWrappers/V21/Attachments/Attachment21.cs rename to Spine/Implementations/V21/Attachments/Attachment21.cs index 21e2f73..bf10b6e 100644 --- a/Spine/Implementations/SpineWrappers/V21/Attachments/Attachment21.cs +++ b/Spine/Implementations/V21/Attachments/Attachment21.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime21; -namespace Spine.Implementations.SpineWrappers.V21.Attachments +namespace Spine.Implementations.V21.Attachments { internal abstract class Attachment21(Attachment innerObject) : IAttachment { diff --git a/Spine/Implementations/SpineWrappers/V21/Attachments/BoundingBoxAttachment21.cs b/Spine/Implementations/V21/Attachments/BoundingBoxAttachment21.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V21/Attachments/BoundingBoxAttachment21.cs rename to Spine/Implementations/V21/Attachments/BoundingBoxAttachment21.cs index 049e530..8da9413 100644 --- a/Spine/Implementations/SpineWrappers/V21/Attachments/BoundingBoxAttachment21.cs +++ b/Spine/Implementations/V21/Attachments/BoundingBoxAttachment21.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V21; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime21; -namespace Spine.Implementations.SpineWrappers.V21.Attachments +namespace Spine.Implementations.V21.Attachments { internal sealed class BoundingBoxAttachment21(BoundingBoxAttachment innerObject) : Attachment21(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V21.Attachments public override BoundingBoxAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot21 st) { diff --git a/Spine/Implementations/SpineWrappers/V21/Attachments/MeshAttachment21.cs b/Spine/Implementations/V21/Attachments/MeshAttachment21.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V21/Attachments/MeshAttachment21.cs rename to Spine/Implementations/V21/Attachments/MeshAttachment21.cs index c77666c..be998bf 100644 --- a/Spine/Implementations/SpineWrappers/V21/Attachments/MeshAttachment21.cs +++ b/Spine/Implementations/V21/Attachments/MeshAttachment21.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V21; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime21; -namespace Spine.Implementations.SpineWrappers.V21.Attachments +namespace Spine.Implementations.V21.Attachments { internal sealed class MeshAttachment21(MeshAttachment innerObject) : Attachment21(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V21.Attachments public override MeshAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot21 st) { diff --git a/Spine/Implementations/SpineWrappers/V21/Attachments/RegionAttachment21.cs b/Spine/Implementations/V21/Attachments/RegionAttachment21.cs similarity index 84% rename from Spine/Implementations/SpineWrappers/V21/Attachments/RegionAttachment21.cs rename to Spine/Implementations/V21/Attachments/RegionAttachment21.cs index 9f6c9fd..48089f8 100644 --- a/Spine/Implementations/SpineWrappers/V21/Attachments/RegionAttachment21.cs +++ b/Spine/Implementations/V21/Attachments/RegionAttachment21.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V21; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime21; -namespace Spine.Implementations.SpineWrappers.V21.Attachments +namespace Spine.Implementations.V21.Attachments { internal sealed class RegionAttachment21(RegionAttachment innerObject) : Attachment21(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V21.Attachments public override RegionAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot21 st) { diff --git a/Spine/Implementations/SpineWrappers/V21/Attachments/SkinnedMeshAttachment21.cs b/Spine/Implementations/V21/Attachments/SkinnedMeshAttachment21.cs similarity index 86% rename from Spine/Implementations/SpineWrappers/V21/Attachments/SkinnedMeshAttachment21.cs rename to Spine/Implementations/V21/Attachments/SkinnedMeshAttachment21.cs index 28f15a3..fe39657 100644 --- a/Spine/Implementations/SpineWrappers/V21/Attachments/SkinnedMeshAttachment21.cs +++ b/Spine/Implementations/V21/Attachments/SkinnedMeshAttachment21.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V21; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime21; -namespace Spine.Implementations.SpineWrappers.V21.Attachments +namespace Spine.Implementations.V21.Attachments { internal sealed class SkinnedMeshAttachment21(SkinnedMeshAttachment innerObject) : Attachment21(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V21.Attachments public override SkinnedMeshAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot21 st) { diff --git a/Spine/Implementations/SpineWrappers/V21/Bone21.cs b/Spine/Implementations/V21/Bone21.cs similarity index 92% rename from Spine/Implementations/SpineWrappers/V21/Bone21.cs rename to Spine/Implementations/V21/Bone21.cs index 19e0e2a..e5a518a 100644 --- a/Spine/Implementations/SpineWrappers/V21/Bone21.cs +++ b/Spine/Implementations/V21/Bone21.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime21; -namespace Spine.Implementations.SpineWrappers.V21 +namespace Spine.Implementations.V21 { internal sealed class Bone21(Bone innerObject, Bone21? parent = null) : IBone { diff --git a/Spine/Implementations/SpineWrappers/V21/Skeleton21.cs b/Spine/Implementations/V21/Skeleton21.cs similarity index 94% rename from Spine/Implementations/SpineWrappers/V21/Skeleton21.cs rename to Spine/Implementations/V21/Skeleton21.cs index 0c8915a..e88fbe8 100644 --- a/Spine/Implementations/SpineWrappers/V21/Skeleton21.cs +++ b/Spine/Implementations/V21/Skeleton21.cs @@ -5,10 +5,10 @@ using System.Text; using System.Threading.Tasks; using System.Collections.Frozen; using System.Collections.Immutable; -using Spine.SpineWrappers; using SpineRuntime21; +using Spine.Interfaces; -namespace Spine.Implementations.SpineWrappers.V21 +namespace Spine.Implementations.V21 { internal sealed class Skeleton21 : ISkeleton { @@ -95,11 +95,6 @@ namespace Spine.Implementations.SpineWrappers.V21 public void SetSlotsToSetupPose() => _o.SetSlotsToSetupPose(); public void Update(float delta) => _o.Update(delta); - public void GetBounds(out float x, out float y, out float w, out float h) - { - _o.GetBounds(out x, out y, out w, out h); - } - public override string ToString() => _o.ToString(); } } diff --git a/Spine/Implementations/SpineWrappers/V21/SkeletonClipping21.cs b/Spine/Implementations/V21/SkeletonClipping21.cs similarity index 90% rename from Spine/Implementations/SpineWrappers/V21/SkeletonClipping21.cs rename to Spine/Implementations/V21/SkeletonClipping21.cs index cedba18..7dd1075 100644 --- a/Spine/Implementations/SpineWrappers/V21/SkeletonClipping21.cs +++ b/Spine/Implementations/V21/SkeletonClipping21.cs @@ -1,5 +1,5 @@ -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using Spine.Utils; using SpineRuntime21; using System; @@ -8,7 +8,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V21 +namespace Spine.Implementations.V21 { internal sealed class SkeletonClipping21 : ISkeletonClipping { diff --git a/Spine/Implementations/SpineWrappers/V21/Skin21.cs b/Spine/Implementations/V21/Skin21.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V21/Skin21.cs rename to Spine/Implementations/V21/Skin21.cs index 08e1b00..389283f 100644 --- a/Spine/Implementations/SpineWrappers/V21/Skin21.cs +++ b/Spine/Implementations/V21/Skin21.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime21; -namespace Spine.Implementations.SpineWrappers.V21 +namespace Spine.Implementations.V21 { internal sealed class Skin21 : ISkin { diff --git a/Spine/Implementations/SpineWrappers/V21/Slot21.cs b/Spine/Implementations/V21/Slot21.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V21/Slot21.cs rename to Spine/Implementations/V21/Slot21.cs index d88eb07..cd87612 100644 --- a/Spine/Implementations/SpineWrappers/V21/Slot21.cs +++ b/Spine/Implementations/V21/Slot21.cs @@ -5,10 +5,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; using SpineRuntime21; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V21 +namespace Spine.Implementations.V21 { internal sealed class Slot21 : ISlot { @@ -39,7 +40,7 @@ namespace Spine.Implementations.SpineWrappers.V21 public float A { get => _o.A; set => _o.A = value; } public IBone Bone => _bone; - public Spine.SpineWrappers.Attachments.IAttachment? Attachment + public IAttachment? Attachment { get { diff --git a/Spine/Implementations/SpineWrappers/V21/SpineObjectData21.cs b/Spine/Implementations/V21/SpineObjectData21.cs similarity index 96% rename from Spine/Implementations/SpineWrappers/V21/SpineObjectData21.cs rename to Spine/Implementations/V21/SpineObjectData21.cs index f14525b..d4a39c4 100644 --- a/Spine/Implementations/SpineWrappers/V21/SpineObjectData21.cs +++ b/Spine/Implementations/V21/SpineObjectData21.cs @@ -6,12 +6,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; using SpineRuntime21; -using Spine.Implementations.SpineWrappers.V21.Attachments; +using Spine.Implementations.V21.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V21 +namespace Spine.Implementations.V21 { [SpineImplementation(2, 1)] internal sealed class SpineObjectData21 : SpineObjectData @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V21 private readonly ImmutableArray _animations; private readonly FrozenDictionary _animationsByName; - public SpineObjectData21(string skelPath, string atlasPath, Spine.SpineWrappers.TextureLoader textureLoader) + public SpineObjectData21(string skelPath, string atlasPath, TextureLoader textureLoader) : base(skelPath, atlasPath, textureLoader) { // 加载 atlas diff --git a/Spine/Implementations/SpineWrappers/V21/TrackEntry21.cs b/Spine/Implementations/V21/TrackEntry21.cs similarity index 91% rename from Spine/Implementations/SpineWrappers/V21/TrackEntry21.cs rename to Spine/Implementations/V21/TrackEntry21.cs index bd0121d..ae0c03b 100644 --- a/Spine/Implementations/SpineWrappers/V21/TrackEntry21.cs +++ b/Spine/Implementations/V21/TrackEntry21.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime21; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V21 +namespace Spine.Implementations.V21 { internal sealed class TrackEntry21(TrackEntry innerObject, AnimationState21 animationState, SpineObjectData21 data): ITrackEntry { @@ -34,7 +34,7 @@ namespace Spine.Implementations.SpineWrappers.V21 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -63,7 +63,7 @@ namespace Spine.Implementations.SpineWrappers.V21 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -92,7 +92,7 @@ namespace Spine.Implementations.SpineWrappers.V21 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; diff --git a/Spine/Implementations/SpineWrappers/V34/Animation34.cs b/Spine/Implementations/V34/Animation34.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V34/Animation34.cs rename to Spine/Implementations/V34/Animation34.cs index 99e97ab..bb0b752 100644 --- a/Spine/Implementations/SpineWrappers/V34/Animation34.cs +++ b/Spine/Implementations/V34/Animation34.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime34; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V34 +namespace Spine.Implementations.V34 { internal sealed class Animation34(Animation innerObject) : IAnimation { diff --git a/Spine/Implementations/SpineWrappers/V34/AnimationState34.cs b/Spine/Implementations/V34/AnimationState34.cs similarity index 94% rename from Spine/Implementations/SpineWrappers/V34/AnimationState34.cs rename to Spine/Implementations/V34/AnimationState34.cs index b9f86c6..bbab97e 100644 --- a/Spine/Implementations/SpineWrappers/V34/AnimationState34.cs +++ b/Spine/Implementations/V34/AnimationState34.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime34; -namespace Spine.Implementations.SpineWrappers.V34 +namespace Spine.Implementations.V34 { internal sealed class AnimationState34(AnimationState innerObject, SpineObjectData34 data) : IAnimationState { @@ -36,7 +36,7 @@ namespace Spine.Implementations.SpineWrappers.V34 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -65,7 +65,7 @@ namespace Spine.Implementations.SpineWrappers.V34 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -94,7 +94,7 @@ namespace Spine.Implementations.SpineWrappers.V34 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; diff --git a/Spine/Implementations/SpineWrappers/V34/Attachments/Attachment34.cs b/Spine/Implementations/V34/Attachments/Attachment34.cs similarity index 80% rename from Spine/Implementations/SpineWrappers/V34/Attachments/Attachment34.cs rename to Spine/Implementations/V34/Attachments/Attachment34.cs index a5664df..ec79000 100644 --- a/Spine/Implementations/SpineWrappers/V34/Attachments/Attachment34.cs +++ b/Spine/Implementations/V34/Attachments/Attachment34.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime34; -namespace Spine.Implementations.SpineWrappers.V34.Attachments +namespace Spine.Implementations.V34.Attachments { internal abstract class Attachment34(Attachment innerObject) : IAttachment { diff --git a/Spine/Implementations/SpineWrappers/V34/Attachments/BoundingBoxAttachment34.cs b/Spine/Implementations/V34/Attachments/BoundingBoxAttachment34.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V34/Attachments/BoundingBoxAttachment34.cs rename to Spine/Implementations/V34/Attachments/BoundingBoxAttachment34.cs index 74aeea5..2584e24 100644 --- a/Spine/Implementations/SpineWrappers/V34/Attachments/BoundingBoxAttachment34.cs +++ b/Spine/Implementations/V34/Attachments/BoundingBoxAttachment34.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V34; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime34; -namespace Spine.Implementations.SpineWrappers.V34.Attachments +namespace Spine.Implementations.V34.Attachments { internal sealed class BoundingBoxAttachment34(BoundingBoxAttachment innerObject) : Attachment34(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V34.Attachments public override BoundingBoxAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot34 st) { diff --git a/Spine/Implementations/SpineWrappers/V34/Attachments/MeshAttachment34.cs b/Spine/Implementations/V34/Attachments/MeshAttachment34.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V34/Attachments/MeshAttachment34.cs rename to Spine/Implementations/V34/Attachments/MeshAttachment34.cs index a16733b..e4868cc 100644 --- a/Spine/Implementations/SpineWrappers/V34/Attachments/MeshAttachment34.cs +++ b/Spine/Implementations/V34/Attachments/MeshAttachment34.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V34; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime34; -namespace Spine.Implementations.SpineWrappers.V34.Attachments +namespace Spine.Implementations.V34.Attachments { internal sealed class MeshAttachment34(MeshAttachment innerObject) : Attachment34(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V34.Attachments public override MeshAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot34 st) { diff --git a/Spine/Implementations/SpineWrappers/V34/Attachments/PathAttachment34.cs b/Spine/Implementations/V34/Attachments/PathAttachment34.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V34/Attachments/PathAttachment34.cs rename to Spine/Implementations/V34/Attachments/PathAttachment34.cs index df3fd69..c4c2084 100644 --- a/Spine/Implementations/SpineWrappers/V34/Attachments/PathAttachment34.cs +++ b/Spine/Implementations/V34/Attachments/PathAttachment34.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V34; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime34; -namespace Spine.Implementations.SpineWrappers.V34.Attachments +namespace Spine.Implementations.V34.Attachments { internal sealed class PathAttachment34(PathAttachment innerObject) : Attachment34(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V34.Attachments public override PathAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot34 st) { diff --git a/Spine/Implementations/SpineWrappers/V34/Attachments/RegionAttachment34.cs b/Spine/Implementations/V34/Attachments/RegionAttachment34.cs similarity index 84% rename from Spine/Implementations/SpineWrappers/V34/Attachments/RegionAttachment34.cs rename to Spine/Implementations/V34/Attachments/RegionAttachment34.cs index 5f1a6f0..db0f312 100644 --- a/Spine/Implementations/SpineWrappers/V34/Attachments/RegionAttachment34.cs +++ b/Spine/Implementations/V34/Attachments/RegionAttachment34.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V34; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime34; -namespace Spine.Implementations.SpineWrappers.V34.Attachments +namespace Spine.Implementations.V34.Attachments { internal sealed class RegionAttachment34(RegionAttachment innerObject) : Attachment34(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V34.Attachments public override RegionAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot34 st) { diff --git a/Spine/Implementations/SpineWrappers/V34/Bone34.cs b/Spine/Implementations/V34/Bone34.cs similarity index 92% rename from Spine/Implementations/SpineWrappers/V34/Bone34.cs rename to Spine/Implementations/V34/Bone34.cs index dff74e7..0223740 100644 --- a/Spine/Implementations/SpineWrappers/V34/Bone34.cs +++ b/Spine/Implementations/V34/Bone34.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime34; -namespace Spine.Implementations.SpineWrappers.V34 +namespace Spine.Implementations.V34 { internal sealed class Bone34(Bone innerObject, Bone34? parent = null) : IBone { diff --git a/Spine/Implementations/SpineWrappers/V34/Skeleton34.cs b/Spine/Implementations/V34/Skeleton34.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V34/Skeleton34.cs rename to Spine/Implementations/V34/Skeleton34.cs index fee3d5e..706c021 100644 --- a/Spine/Implementations/SpineWrappers/V34/Skeleton34.cs +++ b/Spine/Implementations/V34/Skeleton34.cs @@ -5,10 +5,10 @@ using System.Text; using System.Threading.Tasks; using System.Collections.Frozen; using System.Collections.Immutable; -using Spine.SpineWrappers; using SpineRuntime34; +using Spine.Interfaces; -namespace Spine.Implementations.SpineWrappers.V34 +namespace Spine.Implementations.V34 { internal sealed class Skeleton34 : ISkeleton { @@ -95,12 +95,6 @@ namespace Spine.Implementations.SpineWrappers.V34 public void SetSlotsToSetupPose() => _o.SetSlotsToSetupPose(); public void Update(float delta) => _o.Update(delta); - public void GetBounds(out float x, out float y, out float w, out float h) - { - float[] _ = []; - _o.GetBounds(out x, out y, out w, out h); - } - public override string ToString() => _o.ToString(); } } diff --git a/Spine/Implementations/SpineWrappers/V34/SkeletonClipping34.cs b/Spine/Implementations/V34/SkeletonClipping34.cs similarity index 90% rename from Spine/Implementations/SpineWrappers/V34/SkeletonClipping34.cs rename to Spine/Implementations/V34/SkeletonClipping34.cs index 7b5cc8f..7465956 100644 --- a/Spine/Implementations/SpineWrappers/V34/SkeletonClipping34.cs +++ b/Spine/Implementations/V34/SkeletonClipping34.cs @@ -1,5 +1,5 @@ -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using Spine.Utils; using SpineRuntime34; using System; @@ -8,7 +8,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V34 +namespace Spine.Implementations.V34 { internal sealed class SkeletonClipping34 : ISkeletonClipping { diff --git a/Spine/Implementations/SpineWrappers/V34/Skin34.cs b/Spine/Implementations/V34/Skin34.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V34/Skin34.cs rename to Spine/Implementations/V34/Skin34.cs index dd06db8..38870b7 100644 --- a/Spine/Implementations/SpineWrappers/V34/Skin34.cs +++ b/Spine/Implementations/V34/Skin34.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime34; -namespace Spine.Implementations.SpineWrappers.V34 +namespace Spine.Implementations.V34 { internal sealed class Skin34 : ISkin { diff --git a/Spine/Implementations/SpineWrappers/V34/Slot34.cs b/Spine/Implementations/V34/Slot34.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V34/Slot34.cs rename to Spine/Implementations/V34/Slot34.cs index b98b193..28ba545 100644 --- a/Spine/Implementations/SpineWrappers/V34/Slot34.cs +++ b/Spine/Implementations/V34/Slot34.cs @@ -5,10 +5,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; using SpineRuntime34; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V34 +namespace Spine.Implementations.V34 { internal sealed class Slot34 : ISlot { @@ -46,7 +47,7 @@ namespace Spine.Implementations.SpineWrappers.V34 public float A { get => _o.A; set => _o.A = value; } public IBone Bone => _bone; - public Spine.SpineWrappers.Attachments.IAttachment? Attachment + public IAttachment? Attachment { get { diff --git a/Spine/Implementations/SpineWrappers/V34/SpineObjectData34.cs b/Spine/Implementations/V34/SpineObjectData34.cs similarity index 96% rename from Spine/Implementations/SpineWrappers/V34/SpineObjectData34.cs rename to Spine/Implementations/V34/SpineObjectData34.cs index 729f65b..ae31a3a 100644 --- a/Spine/Implementations/SpineWrappers/V34/SpineObjectData34.cs +++ b/Spine/Implementations/V34/SpineObjectData34.cs @@ -6,12 +6,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; using SpineRuntime34; -using Spine.Implementations.SpineWrappers.V34.Attachments; +using Spine.Implementations.V34.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V34 +namespace Spine.Implementations.V34 { [SpineImplementation(3, 4)] internal sealed class SpineObjectData34 : SpineObjectData @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V34 private readonly ImmutableArray _animations; private readonly FrozenDictionary _animationsByName; - public SpineObjectData34(string skelPath, string atlasPath, Spine.SpineWrappers.TextureLoader textureLoader) + public SpineObjectData34(string skelPath, string atlasPath, TextureLoader textureLoader) : base(skelPath, atlasPath, textureLoader) { // 加载 atlas diff --git a/Spine/Implementations/SpineWrappers/V34/TrackEntry34.cs b/Spine/Implementations/V34/TrackEntry34.cs similarity index 91% rename from Spine/Implementations/SpineWrappers/V34/TrackEntry34.cs rename to Spine/Implementations/V34/TrackEntry34.cs index 7bc9482..12f1126 100644 --- a/Spine/Implementations/SpineWrappers/V34/TrackEntry34.cs +++ b/Spine/Implementations/V34/TrackEntry34.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime34; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V34 +namespace Spine.Implementations.V34 { internal sealed class TrackEntry34(TrackEntry innerObject, AnimationState34 animationState, SpineObjectData34 data): ITrackEntry { @@ -34,7 +34,7 @@ namespace Spine.Implementations.SpineWrappers.V34 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -63,7 +63,7 @@ namespace Spine.Implementations.SpineWrappers.V34 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -92,7 +92,7 @@ namespace Spine.Implementations.SpineWrappers.V34 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; diff --git a/Spine/Implementations/SpineWrappers/V35/Animation35.cs b/Spine/Implementations/V35/Animation35.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V35/Animation35.cs rename to Spine/Implementations/V35/Animation35.cs index 5c21bd6..99fe05a 100644 --- a/Spine/Implementations/SpineWrappers/V35/Animation35.cs +++ b/Spine/Implementations/V35/Animation35.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime35; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V35 +namespace Spine.Implementations.V35 { internal sealed class Animation35(Animation innerObject) : IAnimation { diff --git a/Spine/Implementations/SpineWrappers/V35/AnimationState35.cs b/Spine/Implementations/V35/AnimationState35.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V35/AnimationState35.cs rename to Spine/Implementations/V35/AnimationState35.cs index 7673533..8115520 100644 --- a/Spine/Implementations/SpineWrappers/V35/AnimationState35.cs +++ b/Spine/Implementations/V35/AnimationState35.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime35; -namespace Spine.Implementations.SpineWrappers.V35 +namespace Spine.Implementations.V35 { internal sealed class AnimationState35(AnimationState innerObject, SpineObjectData35 data) : IAnimationState { @@ -27,7 +27,7 @@ namespace Spine.Implementations.SpineWrappers.V35 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -56,7 +56,7 @@ namespace Spine.Implementations.SpineWrappers.V35 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Interrupt += f; @@ -85,7 +85,7 @@ namespace Spine.Implementations.SpineWrappers.V35 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -114,7 +114,7 @@ namespace Spine.Implementations.SpineWrappers.V35 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; @@ -143,7 +143,7 @@ namespace Spine.Implementations.SpineWrappers.V35 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Dispose += f; diff --git a/Spine/Implementations/SpineWrappers/V35/Attachments/Attachment35.cs b/Spine/Implementations/V35/Attachments/Attachment35.cs similarity index 80% rename from Spine/Implementations/SpineWrappers/V35/Attachments/Attachment35.cs rename to Spine/Implementations/V35/Attachments/Attachment35.cs index 10bc162..f473f5f 100644 --- a/Spine/Implementations/SpineWrappers/V35/Attachments/Attachment35.cs +++ b/Spine/Implementations/V35/Attachments/Attachment35.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime35; -namespace Spine.Implementations.SpineWrappers.V35.Attachments +namespace Spine.Implementations.V35.Attachments { internal abstract class Attachment35(Attachment innerObject) : IAttachment { diff --git a/Spine/Implementations/SpineWrappers/V35/Attachments/BoundingBoxAttachment35.cs b/Spine/Implementations/V35/Attachments/BoundingBoxAttachment35.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V35/Attachments/BoundingBoxAttachment35.cs rename to Spine/Implementations/V35/Attachments/BoundingBoxAttachment35.cs index d7db614..a8ff535 100644 --- a/Spine/Implementations/SpineWrappers/V35/Attachments/BoundingBoxAttachment35.cs +++ b/Spine/Implementations/V35/Attachments/BoundingBoxAttachment35.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V35; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime35; -namespace Spine.Implementations.SpineWrappers.V35.Attachments +namespace Spine.Implementations.V35.Attachments { internal sealed class BoundingBoxAttachment35(BoundingBoxAttachment innerObject) : Attachment35(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V35.Attachments public override BoundingBoxAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot35 st) { diff --git a/Spine/Implementations/SpineWrappers/V35/Attachments/ClippingAttachment35.cs b/Spine/Implementations/V35/Attachments/ClippingAttachment35.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V35/Attachments/ClippingAttachment35.cs rename to Spine/Implementations/V35/Attachments/ClippingAttachment35.cs index 5fb91ba..d37dae3 100644 --- a/Spine/Implementations/SpineWrappers/V35/Attachments/ClippingAttachment35.cs +++ b/Spine/Implementations/V35/Attachments/ClippingAttachment35.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V35; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime35; -namespace Spine.Implementations.SpineWrappers.V35.Attachments +namespace Spine.Implementations.V35.Attachments { internal sealed class ClippingAttachment35(ClippingAttachment innerObject) : Attachment35(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V35.Attachments public override ClippingAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot35 st) { diff --git a/Spine/Implementations/SpineWrappers/V35/Attachments/MeshAttachment35.cs b/Spine/Implementations/V35/Attachments/MeshAttachment35.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V35/Attachments/MeshAttachment35.cs rename to Spine/Implementations/V35/Attachments/MeshAttachment35.cs index 363576c..e0b4dfc 100644 --- a/Spine/Implementations/SpineWrappers/V35/Attachments/MeshAttachment35.cs +++ b/Spine/Implementations/V35/Attachments/MeshAttachment35.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V35; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime35; -namespace Spine.Implementations.SpineWrappers.V35.Attachments +namespace Spine.Implementations.V35.Attachments { internal sealed class MeshAttachment35(MeshAttachment innerObject) : Attachment35(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V35.Attachments public override MeshAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot35 st) { diff --git a/Spine/Implementations/SpineWrappers/V35/Attachments/PathAttachment35.cs b/Spine/Implementations/V35/Attachments/PathAttachment35.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V35/Attachments/PathAttachment35.cs rename to Spine/Implementations/V35/Attachments/PathAttachment35.cs index 87fc52d..7e0a7c7 100644 --- a/Spine/Implementations/SpineWrappers/V35/Attachments/PathAttachment35.cs +++ b/Spine/Implementations/V35/Attachments/PathAttachment35.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V35; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime35; -namespace Spine.Implementations.SpineWrappers.V35.Attachments +namespace Spine.Implementations.V35.Attachments { internal sealed class PathAttachment35(PathAttachment innerObject) : Attachment35(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V35.Attachments public override PathAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot35 st) { diff --git a/Spine/Implementations/SpineWrappers/V35/Attachments/PointAttachment35.cs b/Spine/Implementations/V35/Attachments/PointAttachment35.cs similarity index 78% rename from Spine/Implementations/SpineWrappers/V35/Attachments/PointAttachment35.cs rename to Spine/Implementations/V35/Attachments/PointAttachment35.cs index 5993724..387c401 100644 --- a/Spine/Implementations/SpineWrappers/V35/Attachments/PointAttachment35.cs +++ b/Spine/Implementations/V35/Attachments/PointAttachment35.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V35; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime35; -namespace Spine.Implementations.SpineWrappers.V35.Attachments +namespace Spine.Implementations.V35.Attachments { internal sealed class PointAttachment35(PointAttachment innerObject) : Attachment35(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V35.Attachments public override PointAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot35 st) { diff --git a/Spine/Implementations/SpineWrappers/V35/Attachments/RegionAttachment35.cs b/Spine/Implementations/V35/Attachments/RegionAttachment35.cs similarity index 84% rename from Spine/Implementations/SpineWrappers/V35/Attachments/RegionAttachment35.cs rename to Spine/Implementations/V35/Attachments/RegionAttachment35.cs index b4d820a..29ebb35 100644 --- a/Spine/Implementations/SpineWrappers/V35/Attachments/RegionAttachment35.cs +++ b/Spine/Implementations/V35/Attachments/RegionAttachment35.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V35; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime35; -namespace Spine.Implementations.SpineWrappers.V35.Attachments +namespace Spine.Implementations.V35.Attachments { internal sealed class RegionAttachment35(RegionAttachment innerObject) : Attachment35(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V35.Attachments public override RegionAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot35 st) { diff --git a/Spine/Implementations/SpineWrappers/V35/Bone35.cs b/Spine/Implementations/V35/Bone35.cs similarity index 92% rename from Spine/Implementations/SpineWrappers/V35/Bone35.cs rename to Spine/Implementations/V35/Bone35.cs index c6f7f3e..f59a567 100644 --- a/Spine/Implementations/SpineWrappers/V35/Bone35.cs +++ b/Spine/Implementations/V35/Bone35.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime35; -namespace Spine.Implementations.SpineWrappers.V35 +namespace Spine.Implementations.V35 { internal sealed class Bone35(Bone innerObject, Bone35? parent = null) : IBone { diff --git a/Spine/Implementations/SpineWrappers/V35/Skeleton35.cs b/Spine/Implementations/V35/Skeleton35.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V35/Skeleton35.cs rename to Spine/Implementations/V35/Skeleton35.cs index 53a77c6..baaa8b5 100644 --- a/Spine/Implementations/SpineWrappers/V35/Skeleton35.cs +++ b/Spine/Implementations/V35/Skeleton35.cs @@ -5,10 +5,10 @@ using System.Text; using System.Threading.Tasks; using System.Collections.Frozen; using System.Collections.Immutable; -using Spine.SpineWrappers; using SpineRuntime35; +using Spine.Interfaces; -namespace Spine.Implementations.SpineWrappers.V35 +namespace Spine.Implementations.V35 { internal sealed class Skeleton35 : ISkeleton { @@ -95,12 +95,6 @@ namespace Spine.Implementations.SpineWrappers.V35 public void SetSlotsToSetupPose() => _o.SetSlotsToSetupPose(); public void Update(float delta) => _o.Update(delta); - public void GetBounds(out float x, out float y, out float w, out float h) - { - float[] _ = []; - _o.GetBounds(out x, out y, out w, out h, ref _); - } - public override string ToString() => _o.ToString(); } } diff --git a/Spine/Implementations/SpineWrappers/V35/SkeletonClipping35.cs b/Spine/Implementations/V35/SkeletonClipping35.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V35/SkeletonClipping35.cs rename to Spine/Implementations/V35/SkeletonClipping35.cs index e55d619..17555b6 100644 --- a/Spine/Implementations/SpineWrappers/V35/SkeletonClipping35.cs +++ b/Spine/Implementations/V35/SkeletonClipping35.cs @@ -1,5 +1,5 @@ -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using Spine.Utils; using SpineRuntime35; using System; @@ -8,7 +8,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V35 +namespace Spine.Implementations.V35 { internal sealed class SkeletonClipping35 : ISkeletonClipping { diff --git a/Spine/Implementations/SpineWrappers/V35/Skin35.cs b/Spine/Implementations/V35/Skin35.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V35/Skin35.cs rename to Spine/Implementations/V35/Skin35.cs index 46af8ef..a2c5a71 100644 --- a/Spine/Implementations/SpineWrappers/V35/Skin35.cs +++ b/Spine/Implementations/V35/Skin35.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime35; -namespace Spine.Implementations.SpineWrappers.V35 +namespace Spine.Implementations.V35 { internal sealed class Skin35 : ISkin { diff --git a/Spine/Implementations/SpineWrappers/V35/Slot35.cs b/Spine/Implementations/V35/Slot35.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V35/Slot35.cs rename to Spine/Implementations/V35/Slot35.cs index f202e03..ae6706a 100644 --- a/Spine/Implementations/SpineWrappers/V35/Slot35.cs +++ b/Spine/Implementations/V35/Slot35.cs @@ -5,10 +5,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; using SpineRuntime35; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V35 +namespace Spine.Implementations.V35 { internal sealed class Slot35 : ISlot { @@ -46,7 +47,7 @@ namespace Spine.Implementations.SpineWrappers.V35 public float A { get => _o.A; set => _o.A = value; } public IBone Bone => _bone; - public Spine.SpineWrappers.Attachments.IAttachment? Attachment + public IAttachment? Attachment { get { diff --git a/Spine/Implementations/SpineWrappers/V35/SpineObjectData35.cs b/Spine/Implementations/V35/SpineObjectData35.cs similarity index 96% rename from Spine/Implementations/SpineWrappers/V35/SpineObjectData35.cs rename to Spine/Implementations/V35/SpineObjectData35.cs index 2d19ea9..4b29545 100644 --- a/Spine/Implementations/SpineWrappers/V35/SpineObjectData35.cs +++ b/Spine/Implementations/V35/SpineObjectData35.cs @@ -6,12 +6,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; using SpineRuntime35; -using Spine.Implementations.SpineWrappers.V35.Attachments; +using Spine.Implementations.V35.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V35 +namespace Spine.Implementations.V35 { [SpineImplementation(3, 5)] internal sealed class SpineObjectData35 : SpineObjectData @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V35 private readonly ImmutableArray _animations; private readonly FrozenDictionary _animationsByName; - public SpineObjectData35(string skelPath, string atlasPath, Spine.SpineWrappers.TextureLoader textureLoader) + public SpineObjectData35(string skelPath, string atlasPath, TextureLoader textureLoader) : base(skelPath, atlasPath, textureLoader) { // 加载 atlas diff --git a/Spine/Implementations/SpineWrappers/V35/TrackEntry35.cs b/Spine/Implementations/V35/TrackEntry35.cs similarity index 90% rename from Spine/Implementations/SpineWrappers/V35/TrackEntry35.cs rename to Spine/Implementations/V35/TrackEntry35.cs index 37de769..0dbf280 100644 --- a/Spine/Implementations/SpineWrappers/V35/TrackEntry35.cs +++ b/Spine/Implementations/V35/TrackEntry35.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime35; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V35 +namespace Spine.Implementations.V35 { internal sealed class TrackEntry35(TrackEntry innerObject, AnimationState35 animationState, SpineObjectData35 data): ITrackEntry { @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V35 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -55,7 +55,7 @@ namespace Spine.Implementations.SpineWrappers.V35 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Interrupt += f; @@ -84,7 +84,7 @@ namespace Spine.Implementations.SpineWrappers.V35 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -113,7 +113,7 @@ namespace Spine.Implementations.SpineWrappers.V35 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; @@ -142,7 +142,7 @@ namespace Spine.Implementations.SpineWrappers.V35 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Dispose += f; diff --git a/Spine/Implementations/SpineWrappers/V36/Animation36.cs b/Spine/Implementations/V36/Animation36.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V36/Animation36.cs rename to Spine/Implementations/V36/Animation36.cs index 51cf8c2..6906276 100644 --- a/Spine/Implementations/SpineWrappers/V36/Animation36.cs +++ b/Spine/Implementations/V36/Animation36.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime36; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V36 +namespace Spine.Implementations.V36 { internal sealed class Animation36(Animation innerObject) : IAnimation { diff --git a/Spine/Implementations/SpineWrappers/V36/AnimationState36.cs b/Spine/Implementations/V36/AnimationState36.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V36/AnimationState36.cs rename to Spine/Implementations/V36/AnimationState36.cs index e5b0c58..359513a 100644 --- a/Spine/Implementations/SpineWrappers/V36/AnimationState36.cs +++ b/Spine/Implementations/V36/AnimationState36.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime36; -namespace Spine.Implementations.SpineWrappers.V36 +namespace Spine.Implementations.V36 { internal sealed class AnimationState36(AnimationState innerObject, SpineObjectData36 data) : IAnimationState { @@ -27,7 +27,7 @@ namespace Spine.Implementations.SpineWrappers.V36 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -56,7 +56,7 @@ namespace Spine.Implementations.SpineWrappers.V36 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Interrupt += f; @@ -85,7 +85,7 @@ namespace Spine.Implementations.SpineWrappers.V36 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -114,7 +114,7 @@ namespace Spine.Implementations.SpineWrappers.V36 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; @@ -143,7 +143,7 @@ namespace Spine.Implementations.SpineWrappers.V36 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Dispose += f; diff --git a/Spine/Implementations/SpineWrappers/V36/Attachments/Attachment36.cs b/Spine/Implementations/V36/Attachments/Attachment36.cs similarity index 80% rename from Spine/Implementations/SpineWrappers/V36/Attachments/Attachment36.cs rename to Spine/Implementations/V36/Attachments/Attachment36.cs index d61bffc..6a1f596 100644 --- a/Spine/Implementations/SpineWrappers/V36/Attachments/Attachment36.cs +++ b/Spine/Implementations/V36/Attachments/Attachment36.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime36; -namespace Spine.Implementations.SpineWrappers.V36.Attachments +namespace Spine.Implementations.V36.Attachments { internal abstract class Attachment36(Attachment innerObject) : IAttachment { diff --git a/Spine/Implementations/SpineWrappers/V36/Attachments/BoundingBoxAttachment36.cs b/Spine/Implementations/V36/Attachments/BoundingBoxAttachment36.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V36/Attachments/BoundingBoxAttachment36.cs rename to Spine/Implementations/V36/Attachments/BoundingBoxAttachment36.cs index 6674bcf..13395c2 100644 --- a/Spine/Implementations/SpineWrappers/V36/Attachments/BoundingBoxAttachment36.cs +++ b/Spine/Implementations/V36/Attachments/BoundingBoxAttachment36.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V36; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime36; -namespace Spine.Implementations.SpineWrappers.V36.Attachments +namespace Spine.Implementations.V36.Attachments { internal sealed class BoundingBoxAttachment36(BoundingBoxAttachment innerObject) : Attachment36(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V36.Attachments public override BoundingBoxAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot36 st) { diff --git a/Spine/Implementations/SpineWrappers/V36/Attachments/ClippingAttachment36.cs b/Spine/Implementations/V36/Attachments/ClippingAttachment36.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V36/Attachments/ClippingAttachment36.cs rename to Spine/Implementations/V36/Attachments/ClippingAttachment36.cs index e8fae73..5918030 100644 --- a/Spine/Implementations/SpineWrappers/V36/Attachments/ClippingAttachment36.cs +++ b/Spine/Implementations/V36/Attachments/ClippingAttachment36.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V36; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime36; -namespace Spine.Implementations.SpineWrappers.V36.Attachments +namespace Spine.Implementations.V36.Attachments { internal sealed class ClippingAttachment36(ClippingAttachment innerObject) : Attachment36(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V36.Attachments public override ClippingAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot36 st) { diff --git a/Spine/Implementations/SpineWrappers/V36/Attachments/MeshAttachment36.cs b/Spine/Implementations/V36/Attachments/MeshAttachment36.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V36/Attachments/MeshAttachment36.cs rename to Spine/Implementations/V36/Attachments/MeshAttachment36.cs index 6040e62..0bcc14e 100644 --- a/Spine/Implementations/SpineWrappers/V36/Attachments/MeshAttachment36.cs +++ b/Spine/Implementations/V36/Attachments/MeshAttachment36.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V36; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime36; -namespace Spine.Implementations.SpineWrappers.V36.Attachments +namespace Spine.Implementations.V36.Attachments { internal sealed class MeshAttachment36(MeshAttachment innerObject) : Attachment36(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V36.Attachments public override MeshAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot36 st) { diff --git a/Spine/Implementations/SpineWrappers/V36/Attachments/PathAttachment36.cs b/Spine/Implementations/V36/Attachments/PathAttachment36.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V36/Attachments/PathAttachment36.cs rename to Spine/Implementations/V36/Attachments/PathAttachment36.cs index b25fc91..8177a7b 100644 --- a/Spine/Implementations/SpineWrappers/V36/Attachments/PathAttachment36.cs +++ b/Spine/Implementations/V36/Attachments/PathAttachment36.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V36; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime36; -namespace Spine.Implementations.SpineWrappers.V36.Attachments +namespace Spine.Implementations.V36.Attachments { internal sealed class PathAttachment36(PathAttachment innerObject) : Attachment36(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V36.Attachments public override PathAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot36 st) { diff --git a/Spine/Implementations/SpineWrappers/V36/Attachments/PointAttachment36.cs b/Spine/Implementations/V36/Attachments/PointAttachment36.cs similarity index 78% rename from Spine/Implementations/SpineWrappers/V36/Attachments/PointAttachment36.cs rename to Spine/Implementations/V36/Attachments/PointAttachment36.cs index 56db482..a94727f 100644 --- a/Spine/Implementations/SpineWrappers/V36/Attachments/PointAttachment36.cs +++ b/Spine/Implementations/V36/Attachments/PointAttachment36.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V36; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime36; -namespace Spine.Implementations.SpineWrappers.V36.Attachments +namespace Spine.Implementations.V36.Attachments { internal sealed class PointAttachment36(PointAttachment innerObject) : Attachment36(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V36.Attachments public override PointAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot36 st) { diff --git a/Spine/Implementations/SpineWrappers/V36/Attachments/RegionAttachment36.cs b/Spine/Implementations/V36/Attachments/RegionAttachment36.cs similarity index 84% rename from Spine/Implementations/SpineWrappers/V36/Attachments/RegionAttachment36.cs rename to Spine/Implementations/V36/Attachments/RegionAttachment36.cs index c0a98fe..806bf36 100644 --- a/Spine/Implementations/SpineWrappers/V36/Attachments/RegionAttachment36.cs +++ b/Spine/Implementations/V36/Attachments/RegionAttachment36.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V36; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime36; -namespace Spine.Implementations.SpineWrappers.V36.Attachments +namespace Spine.Implementations.V36.Attachments { internal sealed class RegionAttachment36(RegionAttachment innerObject) : Attachment36(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V36.Attachments public override RegionAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot36 st) { diff --git a/Spine/Implementations/SpineWrappers/V36/Bone36.cs b/Spine/Implementations/V36/Bone36.cs similarity index 92% rename from Spine/Implementations/SpineWrappers/V36/Bone36.cs rename to Spine/Implementations/V36/Bone36.cs index cca0d7b..74a7e32 100644 --- a/Spine/Implementations/SpineWrappers/V36/Bone36.cs +++ b/Spine/Implementations/V36/Bone36.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime36; -namespace Spine.Implementations.SpineWrappers.V36 +namespace Spine.Implementations.V36 { internal sealed class Bone36(Bone innerObject, Bone36? parent = null) : IBone { diff --git a/Spine/Implementations/SpineWrappers/V36/Skeleton36.cs b/Spine/Implementations/V36/Skeleton36.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V36/Skeleton36.cs rename to Spine/Implementations/V36/Skeleton36.cs index 5429dc9..ee81a72 100644 --- a/Spine/Implementations/SpineWrappers/V36/Skeleton36.cs +++ b/Spine/Implementations/V36/Skeleton36.cs @@ -5,10 +5,10 @@ using System.Text; using System.Threading.Tasks; using System.Collections.Frozen; using System.Collections.Immutable; -using Spine.SpineWrappers; using SpineRuntime36; +using Spine.Interfaces; -namespace Spine.Implementations.SpineWrappers.V36 +namespace Spine.Implementations.V36 { internal sealed class Skeleton36 : ISkeleton { @@ -95,12 +95,6 @@ namespace Spine.Implementations.SpineWrappers.V36 public void SetSlotsToSetupPose() => _o.SetSlotsToSetupPose(); public void Update(float delta) => _o.Update(delta); - public void GetBounds(out float x, out float y, out float w, out float h) - { - float[] _ = []; - _o.GetBounds(out x, out y, out w, out h, ref _); - } - public override string ToString() => _o.ToString(); } } diff --git a/Spine/Implementations/SpineWrappers/V36/SkeletonClipping36.cs b/Spine/Implementations/V36/SkeletonClipping36.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V36/SkeletonClipping36.cs rename to Spine/Implementations/V36/SkeletonClipping36.cs index 5386eed..62a45b0 100644 --- a/Spine/Implementations/SpineWrappers/V36/SkeletonClipping36.cs +++ b/Spine/Implementations/V36/SkeletonClipping36.cs @@ -1,5 +1,5 @@ -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using Spine.Utils; using SpineRuntime36; using System; @@ -8,7 +8,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V36 +namespace Spine.Implementations.V36 { internal sealed class SkeletonClipping36 : ISkeletonClipping { diff --git a/Spine/Implementations/SpineWrappers/V36/Skin36.cs b/Spine/Implementations/V36/Skin36.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V36/Skin36.cs rename to Spine/Implementations/V36/Skin36.cs index 32ccfb1..cd9d6e6 100644 --- a/Spine/Implementations/SpineWrappers/V36/Skin36.cs +++ b/Spine/Implementations/V36/Skin36.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime36; -namespace Spine.Implementations.SpineWrappers.V36 +namespace Spine.Implementations.V36 { internal sealed class Skin36 : ISkin { diff --git a/Spine/Implementations/SpineWrappers/V36/Slot36.cs b/Spine/Implementations/V36/Slot36.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V36/Slot36.cs rename to Spine/Implementations/V36/Slot36.cs index 430c0b5..ddc8d7f 100644 --- a/Spine/Implementations/SpineWrappers/V36/Slot36.cs +++ b/Spine/Implementations/V36/Slot36.cs @@ -5,10 +5,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; using SpineRuntime36; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V36 +namespace Spine.Implementations.V36 { internal sealed class Slot36 : ISlot { @@ -46,7 +47,7 @@ namespace Spine.Implementations.SpineWrappers.V36 public float A { get => _o.A; set => _o.A = value; } public IBone Bone => _bone; - public Spine.SpineWrappers.Attachments.IAttachment? Attachment + public IAttachment? Attachment { get { diff --git a/Spine/Implementations/SpineWrappers/V36/SpineObjectData36.cs b/Spine/Implementations/V36/SpineObjectData36.cs similarity index 96% rename from Spine/Implementations/SpineWrappers/V36/SpineObjectData36.cs rename to Spine/Implementations/V36/SpineObjectData36.cs index 67037a3..e7846f7 100644 --- a/Spine/Implementations/SpineWrappers/V36/SpineObjectData36.cs +++ b/Spine/Implementations/V36/SpineObjectData36.cs @@ -6,12 +6,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; using SpineRuntime36; -using Spine.Implementations.SpineWrappers.V36.Attachments; +using Spine.Implementations.V36.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V36 +namespace Spine.Implementations.V36 { [SpineImplementation(3, 6)] internal sealed class SpineObjectData36 : SpineObjectData @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V36 private readonly ImmutableArray _animations; private readonly FrozenDictionary _animationsByName; - public SpineObjectData36(string skelPath, string atlasPath, Spine.SpineWrappers.TextureLoader textureLoader) + public SpineObjectData36(string skelPath, string atlasPath, TextureLoader textureLoader) : base(skelPath, atlasPath, textureLoader) { // 加载 atlas diff --git a/Spine/Implementations/SpineWrappers/V36/TrackEntry36.cs b/Spine/Implementations/V36/TrackEntry36.cs similarity index 90% rename from Spine/Implementations/SpineWrappers/V36/TrackEntry36.cs rename to Spine/Implementations/V36/TrackEntry36.cs index 6b86817..0c47b1f 100644 --- a/Spine/Implementations/SpineWrappers/V36/TrackEntry36.cs +++ b/Spine/Implementations/V36/TrackEntry36.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime36; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V36 +namespace Spine.Implementations.V36 { internal sealed class TrackEntry36(TrackEntry innerObject, AnimationState36 animationState, SpineObjectData36 data): ITrackEntry { @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V36 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -55,7 +55,7 @@ namespace Spine.Implementations.SpineWrappers.V36 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Interrupt += f; @@ -84,7 +84,7 @@ namespace Spine.Implementations.SpineWrappers.V36 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -113,7 +113,7 @@ namespace Spine.Implementations.SpineWrappers.V36 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; @@ -142,7 +142,7 @@ namespace Spine.Implementations.SpineWrappers.V36 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Dispose += f; diff --git a/Spine/Implementations/SpineWrappers/V37/Animation37.cs b/Spine/Implementations/V37/Animation37.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V37/Animation37.cs rename to Spine/Implementations/V37/Animation37.cs index 9b21d5a..69d12a5 100644 --- a/Spine/Implementations/SpineWrappers/V37/Animation37.cs +++ b/Spine/Implementations/V37/Animation37.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime37; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V37 +namespace Spine.Implementations.V37 { internal sealed class Animation37(Animation innerObject) : IAnimation { diff --git a/Spine/Implementations/SpineWrappers/V37/AnimationState37.cs b/Spine/Implementations/V37/AnimationState37.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V37/AnimationState37.cs rename to Spine/Implementations/V37/AnimationState37.cs index f14f93c..3237e19 100644 --- a/Spine/Implementations/SpineWrappers/V37/AnimationState37.cs +++ b/Spine/Implementations/V37/AnimationState37.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime37; -namespace Spine.Implementations.SpineWrappers.V37 +namespace Spine.Implementations.V37 { internal sealed class AnimationState37(AnimationState innerObject, SpineObjectData37 data) : IAnimationState { @@ -27,7 +27,7 @@ namespace Spine.Implementations.SpineWrappers.V37 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -56,7 +56,7 @@ namespace Spine.Implementations.SpineWrappers.V37 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Interrupt += f; @@ -85,7 +85,7 @@ namespace Spine.Implementations.SpineWrappers.V37 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -114,7 +114,7 @@ namespace Spine.Implementations.SpineWrappers.V37 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; @@ -143,7 +143,7 @@ namespace Spine.Implementations.SpineWrappers.V37 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Dispose += f; diff --git a/Spine/Implementations/SpineWrappers/V37/Attachments/Attachment37.cs b/Spine/Implementations/V37/Attachments/Attachment37.cs similarity index 80% rename from Spine/Implementations/SpineWrappers/V37/Attachments/Attachment37.cs rename to Spine/Implementations/V37/Attachments/Attachment37.cs index 2a23a2c..898f701 100644 --- a/Spine/Implementations/SpineWrappers/V37/Attachments/Attachment37.cs +++ b/Spine/Implementations/V37/Attachments/Attachment37.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime37; -namespace Spine.Implementations.SpineWrappers.V37.Attachments +namespace Spine.Implementations.V37.Attachments { internal abstract class Attachment37(Attachment innerObject) : IAttachment { diff --git a/Spine/Implementations/SpineWrappers/V37/Attachments/BoundingBoxAttachment37.cs b/Spine/Implementations/V37/Attachments/BoundingBoxAttachment37.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V37/Attachments/BoundingBoxAttachment37.cs rename to Spine/Implementations/V37/Attachments/BoundingBoxAttachment37.cs index 270ac8d..efc3102 100644 --- a/Spine/Implementations/SpineWrappers/V37/Attachments/BoundingBoxAttachment37.cs +++ b/Spine/Implementations/V37/Attachments/BoundingBoxAttachment37.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V37; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime37; -namespace Spine.Implementations.SpineWrappers.V37.Attachments +namespace Spine.Implementations.V37.Attachments { internal sealed class BoundingBoxAttachment37(BoundingBoxAttachment innerObject) : Attachment37(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V37.Attachments public override BoundingBoxAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot37 st) { diff --git a/Spine/Implementations/SpineWrappers/V37/Attachments/ClippingAttachment37.cs b/Spine/Implementations/V37/Attachments/ClippingAttachment37.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V37/Attachments/ClippingAttachment37.cs rename to Spine/Implementations/V37/Attachments/ClippingAttachment37.cs index b8761df..e60c823 100644 --- a/Spine/Implementations/SpineWrappers/V37/Attachments/ClippingAttachment37.cs +++ b/Spine/Implementations/V37/Attachments/ClippingAttachment37.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V37; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime37; -namespace Spine.Implementations.SpineWrappers.V37.Attachments +namespace Spine.Implementations.V37.Attachments { internal sealed class ClippingAttachment37(ClippingAttachment innerObject) : Attachment37(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V37.Attachments public override ClippingAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot37 st) { diff --git a/Spine/Implementations/SpineWrappers/V37/Attachments/MeshAttachment37.cs b/Spine/Implementations/V37/Attachments/MeshAttachment37.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V37/Attachments/MeshAttachment37.cs rename to Spine/Implementations/V37/Attachments/MeshAttachment37.cs index 6937945..4ef404e 100644 --- a/Spine/Implementations/SpineWrappers/V37/Attachments/MeshAttachment37.cs +++ b/Spine/Implementations/V37/Attachments/MeshAttachment37.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V37; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime37; -namespace Spine.Implementations.SpineWrappers.V37.Attachments +namespace Spine.Implementations.V37.Attachments { internal sealed class MeshAttachment37(MeshAttachment innerObject) : Attachment37(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V37.Attachments public override MeshAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot37 st) { diff --git a/Spine/Implementations/SpineWrappers/V37/Attachments/PathAttachment37.cs b/Spine/Implementations/V37/Attachments/PathAttachment37.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V37/Attachments/PathAttachment37.cs rename to Spine/Implementations/V37/Attachments/PathAttachment37.cs index 412051b..4574252 100644 --- a/Spine/Implementations/SpineWrappers/V37/Attachments/PathAttachment37.cs +++ b/Spine/Implementations/V37/Attachments/PathAttachment37.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V37; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime37; -namespace Spine.Implementations.SpineWrappers.V37.Attachments +namespace Spine.Implementations.V37.Attachments { internal sealed class PathAttachment37(PathAttachment innerObject) : Attachment37(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V37.Attachments public override PathAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot37 st) { diff --git a/Spine/Implementations/SpineWrappers/V37/Attachments/PointAttachment37.cs b/Spine/Implementations/V37/Attachments/PointAttachment37.cs similarity index 78% rename from Spine/Implementations/SpineWrappers/V37/Attachments/PointAttachment37.cs rename to Spine/Implementations/V37/Attachments/PointAttachment37.cs index fc9a1fc..8a804dd 100644 --- a/Spine/Implementations/SpineWrappers/V37/Attachments/PointAttachment37.cs +++ b/Spine/Implementations/V37/Attachments/PointAttachment37.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V37; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime37; -namespace Spine.Implementations.SpineWrappers.V37.Attachments +namespace Spine.Implementations.V37.Attachments { internal sealed class PointAttachment37(PointAttachment innerObject) : Attachment37(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V37.Attachments public override PointAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot37 st) { diff --git a/Spine/Implementations/SpineWrappers/V37/Attachments/RegionAttachment37.cs b/Spine/Implementations/V37/Attachments/RegionAttachment37.cs similarity index 84% rename from Spine/Implementations/SpineWrappers/V37/Attachments/RegionAttachment37.cs rename to Spine/Implementations/V37/Attachments/RegionAttachment37.cs index f772c09..2f65e69 100644 --- a/Spine/Implementations/SpineWrappers/V37/Attachments/RegionAttachment37.cs +++ b/Spine/Implementations/V37/Attachments/RegionAttachment37.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V37; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime37; -namespace Spine.Implementations.SpineWrappers.V37.Attachments +namespace Spine.Implementations.V37.Attachments { internal sealed class RegionAttachment37(RegionAttachment innerObject) : Attachment37(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V37.Attachments public override RegionAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot37 st) { diff --git a/Spine/Implementations/SpineWrappers/V37/Bone37.cs b/Spine/Implementations/V37/Bone37.cs similarity index 92% rename from Spine/Implementations/SpineWrappers/V37/Bone37.cs rename to Spine/Implementations/V37/Bone37.cs index 571d023..f55f036 100644 --- a/Spine/Implementations/SpineWrappers/V37/Bone37.cs +++ b/Spine/Implementations/V37/Bone37.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime37; -namespace Spine.Implementations.SpineWrappers.V37 +namespace Spine.Implementations.V37 { internal sealed class Bone37(Bone innerObject, Bone37? parent = null) : IBone { diff --git a/Spine/Implementations/SpineWrappers/V37/Skeleton37.cs b/Spine/Implementations/V37/Skeleton37.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V37/Skeleton37.cs rename to Spine/Implementations/V37/Skeleton37.cs index fad3cf6..d3e233d 100644 --- a/Spine/Implementations/SpineWrappers/V37/Skeleton37.cs +++ b/Spine/Implementations/V37/Skeleton37.cs @@ -5,10 +5,10 @@ using System.Text; using System.Threading.Tasks; using System.Collections.Frozen; using System.Collections.Immutable; -using Spine.SpineWrappers; using SpineRuntime37; +using Spine.Interfaces; -namespace Spine.Implementations.SpineWrappers.V37 +namespace Spine.Implementations.V37 { internal sealed class Skeleton37 : ISkeleton { @@ -95,12 +95,6 @@ namespace Spine.Implementations.SpineWrappers.V37 public void SetSlotsToSetupPose() => _o.SetSlotsToSetupPose(); public void Update(float delta) => _o.Update(delta); - public void GetBounds(out float x, out float y, out float w, out float h) - { - float[] _ = []; - _o.GetBounds(out x, out y, out w, out h, ref _); - } - public override string ToString() => _o.ToString(); } } diff --git a/Spine/Implementations/SpineWrappers/V37/SkeletonClipping37.cs b/Spine/Implementations/V37/SkeletonClipping37.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V37/SkeletonClipping37.cs rename to Spine/Implementations/V37/SkeletonClipping37.cs index ed6d412..9be4656 100644 --- a/Spine/Implementations/SpineWrappers/V37/SkeletonClipping37.cs +++ b/Spine/Implementations/V37/SkeletonClipping37.cs @@ -1,5 +1,5 @@ -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using Spine.Utils; using SpineRuntime37; using System; @@ -8,7 +8,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V37 +namespace Spine.Implementations.V37 { internal sealed class SkeletonClipping37 : ISkeletonClipping { diff --git a/Spine/Implementations/SpineWrappers/V37/Skin37.cs b/Spine/Implementations/V37/Skin37.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V37/Skin37.cs rename to Spine/Implementations/V37/Skin37.cs index 41c41fc..94ecb9e 100644 --- a/Spine/Implementations/SpineWrappers/V37/Skin37.cs +++ b/Spine/Implementations/V37/Skin37.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime37; -namespace Spine.Implementations.SpineWrappers.V37 +namespace Spine.Implementations.V37 { internal sealed class Skin37 : ISkin { diff --git a/Spine/Implementations/SpineWrappers/V37/Slot37.cs b/Spine/Implementations/V37/Slot37.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V37/Slot37.cs rename to Spine/Implementations/V37/Slot37.cs index 55c5330..e54292d 100644 --- a/Spine/Implementations/SpineWrappers/V37/Slot37.cs +++ b/Spine/Implementations/V37/Slot37.cs @@ -5,10 +5,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; using SpineRuntime37; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V37 +namespace Spine.Implementations.V37 { internal sealed class Slot37 : ISlot { @@ -46,7 +47,7 @@ namespace Spine.Implementations.SpineWrappers.V37 public float A { get => _o.A; set => _o.A = value; } public IBone Bone => _bone; - public Spine.SpineWrappers.Attachments.IAttachment? Attachment + public IAttachment? Attachment { get { diff --git a/Spine/Implementations/SpineWrappers/V37/SpineObjectData37.cs b/Spine/Implementations/V37/SpineObjectData37.cs similarity index 96% rename from Spine/Implementations/SpineWrappers/V37/SpineObjectData37.cs rename to Spine/Implementations/V37/SpineObjectData37.cs index 3851834..b8674b2 100644 --- a/Spine/Implementations/SpineWrappers/V37/SpineObjectData37.cs +++ b/Spine/Implementations/V37/SpineObjectData37.cs @@ -6,12 +6,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; using SpineRuntime37; -using Spine.Implementations.SpineWrappers.V37.Attachments; +using Spine.Implementations.V37.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V37 +namespace Spine.Implementations.V37 { [SpineImplementation(3, 7)] internal sealed class SpineObjectData37 : SpineObjectData @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V37 private readonly ImmutableArray _animations; private readonly FrozenDictionary _animationsByName; - public SpineObjectData37(string skelPath, string atlasPath, Spine.SpineWrappers.TextureLoader textureLoader) + public SpineObjectData37(string skelPath, string atlasPath, TextureLoader textureLoader) : base(skelPath, atlasPath, textureLoader) { // 加载 atlas diff --git a/Spine/Implementations/SpineWrappers/V37/TrackEntry37.cs b/Spine/Implementations/V37/TrackEntry37.cs similarity index 90% rename from Spine/Implementations/SpineWrappers/V37/TrackEntry37.cs rename to Spine/Implementations/V37/TrackEntry37.cs index cf1c90e..418b6db 100644 --- a/Spine/Implementations/SpineWrappers/V37/TrackEntry37.cs +++ b/Spine/Implementations/V37/TrackEntry37.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime37; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V37 +namespace Spine.Implementations.V37 { internal sealed class TrackEntry37(TrackEntry innerObject, AnimationState37 animationState, SpineObjectData37 data): ITrackEntry { @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V37 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -55,7 +55,7 @@ namespace Spine.Implementations.SpineWrappers.V37 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Interrupt += f; @@ -84,7 +84,7 @@ namespace Spine.Implementations.SpineWrappers.V37 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -113,7 +113,7 @@ namespace Spine.Implementations.SpineWrappers.V37 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; @@ -142,7 +142,7 @@ namespace Spine.Implementations.SpineWrappers.V37 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Dispose += f; diff --git a/Spine/Implementations/SpineWrappers/V38/Animation38.cs b/Spine/Implementations/V38/Animation38.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V38/Animation38.cs rename to Spine/Implementations/V38/Animation38.cs index 5b05e73..051449e 100644 --- a/Spine/Implementations/SpineWrappers/V38/Animation38.cs +++ b/Spine/Implementations/V38/Animation38.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime38; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V38 +namespace Spine.Implementations.V38 { internal sealed class Animation38(Animation innerObject) : IAnimation { diff --git a/Spine/Implementations/SpineWrappers/V38/AnimationState38.cs b/Spine/Implementations/V38/AnimationState38.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V38/AnimationState38.cs rename to Spine/Implementations/V38/AnimationState38.cs index db83d08..c239ac4 100644 --- a/Spine/Implementations/SpineWrappers/V38/AnimationState38.cs +++ b/Spine/Implementations/V38/AnimationState38.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime38; -namespace Spine.Implementations.SpineWrappers.V38 +namespace Spine.Implementations.V38 { internal sealed class AnimationState38(AnimationState innerObject, SpineObjectData38 data) : IAnimationState { @@ -27,7 +27,7 @@ namespace Spine.Implementations.SpineWrappers.V38 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -56,7 +56,7 @@ namespace Spine.Implementations.SpineWrappers.V38 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Interrupt += f; @@ -85,7 +85,7 @@ namespace Spine.Implementations.SpineWrappers.V38 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -114,7 +114,7 @@ namespace Spine.Implementations.SpineWrappers.V38 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; @@ -143,7 +143,7 @@ namespace Spine.Implementations.SpineWrappers.V38 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Dispose += f; diff --git a/Spine/Implementations/SpineWrappers/V38/Attachments/Attachment38.cs b/Spine/Implementations/V38/Attachments/Attachment38.cs similarity index 81% rename from Spine/Implementations/SpineWrappers/V38/Attachments/Attachment38.cs rename to Spine/Implementations/V38/Attachments/Attachment38.cs index 277cfbd..1ae5b39 100644 --- a/Spine/Implementations/SpineWrappers/V38/Attachments/Attachment38.cs +++ b/Spine/Implementations/V38/Attachments/Attachment38.cs @@ -3,12 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime38; using SpineRuntime38.Attachments; -namespace Spine.Implementations.SpineWrappers.V38.Attachments +namespace Spine.Implementations.V38.Attachments { internal abstract class Attachment38(Attachment innerObject) : IAttachment { diff --git a/Spine/Implementations/SpineWrappers/V38/Attachments/BoundingBoxAttachment38.cs b/Spine/Implementations/V38/Attachments/BoundingBoxAttachment38.cs similarity index 80% rename from Spine/Implementations/SpineWrappers/V38/Attachments/BoundingBoxAttachment38.cs rename to Spine/Implementations/V38/Attachments/BoundingBoxAttachment38.cs index 4ce6da8..923b5af 100644 --- a/Spine/Implementations/SpineWrappers/V38/Attachments/BoundingBoxAttachment38.cs +++ b/Spine/Implementations/V38/Attachments/BoundingBoxAttachment38.cs @@ -3,11 +3,13 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V38; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime38; using SpineRuntime38.Attachments; -namespace Spine.Implementations.SpineWrappers.V38.Attachments +namespace Spine.Implementations.V38.Attachments { internal sealed class BoundingBoxAttachment38(BoundingBoxAttachment innerObject) : Attachment38(innerObject), @@ -17,7 +19,7 @@ namespace Spine.Implementations.SpineWrappers.V38.Attachments public override BoundingBoxAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot38 st) { diff --git a/Spine/Implementations/SpineWrappers/V38/Attachments/ClippingAttachment38.cs b/Spine/Implementations/V38/Attachments/ClippingAttachment38.cs similarity index 80% rename from Spine/Implementations/SpineWrappers/V38/Attachments/ClippingAttachment38.cs rename to Spine/Implementations/V38/Attachments/ClippingAttachment38.cs index ef75ecb..8dee594 100644 --- a/Spine/Implementations/SpineWrappers/V38/Attachments/ClippingAttachment38.cs +++ b/Spine/Implementations/V38/Attachments/ClippingAttachment38.cs @@ -3,11 +3,13 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V38; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime38; using SpineRuntime38.Attachments; -namespace Spine.Implementations.SpineWrappers.V38.Attachments +namespace Spine.Implementations.V38.Attachments { internal sealed class ClippingAttachment38(ClippingAttachment innerObject) : Attachment38(innerObject), @@ -17,7 +19,7 @@ namespace Spine.Implementations.SpineWrappers.V38.Attachments public override ClippingAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot38 st) { diff --git a/Spine/Implementations/SpineWrappers/V38/Attachments/MeshAttachment38.cs b/Spine/Implementations/V38/Attachments/MeshAttachment38.cs similarity index 86% rename from Spine/Implementations/SpineWrappers/V38/Attachments/MeshAttachment38.cs rename to Spine/Implementations/V38/Attachments/MeshAttachment38.cs index 46bd51e..4ce3109 100644 --- a/Spine/Implementations/SpineWrappers/V38/Attachments/MeshAttachment38.cs +++ b/Spine/Implementations/V38/Attachments/MeshAttachment38.cs @@ -3,11 +3,13 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V38; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime38; using SpineRuntime38.Attachments; -namespace Spine.Implementations.SpineWrappers.V38.Attachments +namespace Spine.Implementations.V38.Attachments { internal sealed class MeshAttachment38(MeshAttachment innerObject) : Attachment38(innerObject), @@ -17,7 +19,7 @@ namespace Spine.Implementations.SpineWrappers.V38.Attachments public override MeshAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot38 st) { diff --git a/Spine/Implementations/SpineWrappers/V38/Attachments/PathAttachment38.cs b/Spine/Implementations/V38/Attachments/PathAttachment38.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V38/Attachments/PathAttachment38.cs rename to Spine/Implementations/V38/Attachments/PathAttachment38.cs index ef908f8..d0636ae 100644 --- a/Spine/Implementations/SpineWrappers/V38/Attachments/PathAttachment38.cs +++ b/Spine/Implementations/V38/Attachments/PathAttachment38.cs @@ -3,11 +3,13 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V38; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime38; using SpineRuntime38.Attachments; -namespace Spine.Implementations.SpineWrappers.V38.Attachments +namespace Spine.Implementations.V38.Attachments { internal sealed class PathAttachment38(PathAttachment innerObject) : Attachment38(innerObject), @@ -17,7 +19,7 @@ namespace Spine.Implementations.SpineWrappers.V38.Attachments public override PathAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot38 st) { diff --git a/Spine/Implementations/SpineWrappers/V38/Attachments/PointAttachment38.cs b/Spine/Implementations/V38/Attachments/PointAttachment38.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V38/Attachments/PointAttachment38.cs rename to Spine/Implementations/V38/Attachments/PointAttachment38.cs index 3d1c80c..84e3c62 100644 --- a/Spine/Implementations/SpineWrappers/V38/Attachments/PointAttachment38.cs +++ b/Spine/Implementations/V38/Attachments/PointAttachment38.cs @@ -3,11 +3,13 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V38; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime38; using SpineRuntime38.Attachments; -namespace Spine.Implementations.SpineWrappers.V38.Attachments +namespace Spine.Implementations.V38.Attachments { internal sealed class PointAttachment38(PointAttachment innerObject) : Attachment38(innerObject), @@ -17,7 +19,7 @@ namespace Spine.Implementations.SpineWrappers.V38.Attachments public override PointAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot38 st) { diff --git a/Spine/Implementations/SpineWrappers/V38/Attachments/RegionAttachment38.cs b/Spine/Implementations/V38/Attachments/RegionAttachment38.cs similarity index 84% rename from Spine/Implementations/SpineWrappers/V38/Attachments/RegionAttachment38.cs rename to Spine/Implementations/V38/Attachments/RegionAttachment38.cs index 5d901f6..2ea4526 100644 --- a/Spine/Implementations/SpineWrappers/V38/Attachments/RegionAttachment38.cs +++ b/Spine/Implementations/V38/Attachments/RegionAttachment38.cs @@ -3,11 +3,13 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V38; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime38; using SpineRuntime38.Attachments; -namespace Spine.Implementations.SpineWrappers.V38.Attachments +namespace Spine.Implementations.V38.Attachments { internal sealed class RegionAttachment38(RegionAttachment innerObject) : Attachment38(innerObject), @@ -17,7 +19,7 @@ namespace Spine.Implementations.SpineWrappers.V38.Attachments public override RegionAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot38 st) { diff --git a/Spine/Implementations/SpineWrappers/V38/Bone38.cs b/Spine/Implementations/V38/Bone38.cs similarity index 91% rename from Spine/Implementations/SpineWrappers/V38/Bone38.cs rename to Spine/Implementations/V38/Bone38.cs index 6b49878..799b2cf 100644 --- a/Spine/Implementations/SpineWrappers/V38/Bone38.cs +++ b/Spine/Implementations/V38/Bone38.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime38; -namespace Spine.Implementations.SpineWrappers.V38 +namespace Spine.Implementations.V38 { internal sealed class Bone38(Bone innerObject, Bone38? parent = null) : IBone { diff --git a/Spine/Implementations/SpineWrappers/V38/Skeleton38.cs b/Spine/Implementations/V38/Skeleton38.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V38/Skeleton38.cs rename to Spine/Implementations/V38/Skeleton38.cs index 7b11cdb..9990955 100644 --- a/Spine/Implementations/SpineWrappers/V38/Skeleton38.cs +++ b/Spine/Implementations/V38/Skeleton38.cs @@ -5,10 +5,10 @@ using System.Text; using System.Threading.Tasks; using System.Collections.Frozen; using System.Collections.Immutable; -using Spine.SpineWrappers; using SpineRuntime38; +using Spine.Interfaces; -namespace Spine.Implementations.SpineWrappers.V38 +namespace Spine.Implementations.V38 { internal sealed class Skeleton38 : ISkeleton { @@ -95,12 +95,6 @@ namespace Spine.Implementations.SpineWrappers.V38 public void SetSlotsToSetupPose() => _o.SetSlotsToSetupPose(); public void Update(float delta) => _o.Update(delta); - public void GetBounds(out float x, out float y, out float w, out float h) - { - float[] _ = []; - _o.GetBounds(out x, out y, out w, out h, ref _); - } - public override string ToString() => _o.ToString(); } } diff --git a/Spine/Implementations/SpineWrappers/V38/SkeletonClipping38.cs b/Spine/Implementations/V38/SkeletonClipping38.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V38/SkeletonClipping38.cs rename to Spine/Implementations/V38/SkeletonClipping38.cs index c3e07dd..a5d7eca 100644 --- a/Spine/Implementations/SpineWrappers/V38/SkeletonClipping38.cs +++ b/Spine/Implementations/V38/SkeletonClipping38.cs @@ -1,5 +1,5 @@ -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using Spine.Utils; using SpineRuntime38; using System; @@ -8,7 +8,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V38 +namespace Spine.Implementations.V38 { internal sealed class SkeletonClipping38 : ISkeletonClipping { diff --git a/Spine/Implementations/SpineWrappers/V38/Skin38.cs b/Spine/Implementations/V38/Skin38.cs similarity index 92% rename from Spine/Implementations/SpineWrappers/V38/Skin38.cs rename to Spine/Implementations/V38/Skin38.cs index 77af872..8571827 100644 --- a/Spine/Implementations/SpineWrappers/V38/Skin38.cs +++ b/Spine/Implementations/V38/Skin38.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime38; -namespace Spine.Implementations.SpineWrappers.V38 +namespace Spine.Implementations.V38 { internal sealed class Skin38 : ISkin { diff --git a/Spine/Implementations/SpineWrappers/V38/Slot38.cs b/Spine/Implementations/V38/Slot38.cs similarity index 94% rename from Spine/Implementations/SpineWrappers/V38/Slot38.cs rename to Spine/Implementations/V38/Slot38.cs index 6255fca..ae5ac73 100644 --- a/Spine/Implementations/SpineWrappers/V38/Slot38.cs +++ b/Spine/Implementations/V38/Slot38.cs @@ -5,11 +5,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; using SpineRuntime38; using SpineRuntime38.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V38 +namespace Spine.Implementations.V38 { internal sealed class Slot38 : ISlot { @@ -47,7 +48,7 @@ namespace Spine.Implementations.SpineWrappers.V38 public float A { get => _o.A; set => _o.A = value; } public IBone Bone => _bone; - public Spine.SpineWrappers.Attachments.IAttachment? Attachment + public IAttachment? Attachment { get { diff --git a/Spine/Implementations/SpineWrappers/V38/SpineObjectData38.cs b/Spine/Implementations/V38/SpineObjectData38.cs similarity index 96% rename from Spine/Implementations/SpineWrappers/V38/SpineObjectData38.cs rename to Spine/Implementations/V38/SpineObjectData38.cs index 45265e8..680d43c 100644 --- a/Spine/Implementations/SpineWrappers/V38/SpineObjectData38.cs +++ b/Spine/Implementations/V38/SpineObjectData38.cs @@ -6,13 +6,13 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; using SpineRuntime38; using SpineRuntime38.Attachments; -using Spine.Implementations.SpineWrappers.V38.Attachments; +using Spine.Implementations.V38.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V38 +namespace Spine.Implementations.V38 { [SpineImplementation(3, 8)] internal sealed class SpineObjectData38 : SpineObjectData @@ -27,7 +27,7 @@ namespace Spine.Implementations.SpineWrappers.V38 private readonly ImmutableArray _animations; private readonly FrozenDictionary _animationsByName; - public SpineObjectData38(string skelPath, string atlasPath, Spine.SpineWrappers.TextureLoader textureLoader) + public SpineObjectData38(string skelPath, string atlasPath, TextureLoader textureLoader) : base(skelPath, atlasPath, textureLoader) { // 加载 atlas diff --git a/Spine/Implementations/SpineWrappers/V38/TrackEntry38.cs b/Spine/Implementations/V38/TrackEntry38.cs similarity index 90% rename from Spine/Implementations/SpineWrappers/V38/TrackEntry38.cs rename to Spine/Implementations/V38/TrackEntry38.cs index 48f8822..ba77d78 100644 --- a/Spine/Implementations/SpineWrappers/V38/TrackEntry38.cs +++ b/Spine/Implementations/V38/TrackEntry38.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime38; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V38 +namespace Spine.Implementations.V38 { internal sealed class TrackEntry38(TrackEntry innerObject, AnimationState38 animationState, SpineObjectData38 data): ITrackEntry { @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V38 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -55,7 +55,7 @@ namespace Spine.Implementations.SpineWrappers.V38 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Interrupt += f; @@ -84,7 +84,7 @@ namespace Spine.Implementations.SpineWrappers.V38 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -113,7 +113,7 @@ namespace Spine.Implementations.SpineWrappers.V38 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; @@ -142,7 +142,7 @@ namespace Spine.Implementations.SpineWrappers.V38 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Dispose += f; diff --git a/Spine/Implementations/SpineWrappers/V40/Animation40.cs b/Spine/Implementations/V40/Animation40.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V40/Animation40.cs rename to Spine/Implementations/V40/Animation40.cs index 5198441..39a6c87 100644 --- a/Spine/Implementations/SpineWrappers/V40/Animation40.cs +++ b/Spine/Implementations/V40/Animation40.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime40; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V40 +namespace Spine.Implementations.V40 { internal sealed class Animation40(Animation innerObject) : IAnimation { diff --git a/Spine/Implementations/SpineWrappers/V40/AnimationState40.cs b/Spine/Implementations/V40/AnimationState40.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V40/AnimationState40.cs rename to Spine/Implementations/V40/AnimationState40.cs index e9d12ca..7aadee6 100644 --- a/Spine/Implementations/SpineWrappers/V40/AnimationState40.cs +++ b/Spine/Implementations/V40/AnimationState40.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime40; -namespace Spine.Implementations.SpineWrappers.V40 +namespace Spine.Implementations.V40 { internal sealed class AnimationState40(AnimationState innerObject, SpineObjectData40 data) : IAnimationState { @@ -27,7 +27,7 @@ namespace Spine.Implementations.SpineWrappers.V40 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -56,7 +56,7 @@ namespace Spine.Implementations.SpineWrappers.V40 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Interrupt += f; @@ -85,7 +85,7 @@ namespace Spine.Implementations.SpineWrappers.V40 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -114,7 +114,7 @@ namespace Spine.Implementations.SpineWrappers.V40 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; @@ -143,7 +143,7 @@ namespace Spine.Implementations.SpineWrappers.V40 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Dispose += f; diff --git a/Spine/Implementations/SpineWrappers/V40/Attachments/Attachment40.cs b/Spine/Implementations/V40/Attachments/Attachment40.cs similarity index 80% rename from Spine/Implementations/SpineWrappers/V40/Attachments/Attachment40.cs rename to Spine/Implementations/V40/Attachments/Attachment40.cs index 9241919..095218d 100644 --- a/Spine/Implementations/SpineWrappers/V40/Attachments/Attachment40.cs +++ b/Spine/Implementations/V40/Attachments/Attachment40.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime40; -namespace Spine.Implementations.SpineWrappers.V40.Attachments +namespace Spine.Implementations.V40.Attachments { internal abstract class Attachment40(Attachment innerObject) : IAttachment { diff --git a/Spine/Implementations/SpineWrappers/V40/Attachments/BoundingBoxAttachment40.cs b/Spine/Implementations/V40/Attachments/BoundingBoxAttachment40.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V40/Attachments/BoundingBoxAttachment40.cs rename to Spine/Implementations/V40/Attachments/BoundingBoxAttachment40.cs index 23b6043..14b7897 100644 --- a/Spine/Implementations/SpineWrappers/V40/Attachments/BoundingBoxAttachment40.cs +++ b/Spine/Implementations/V40/Attachments/BoundingBoxAttachment40.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V40; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime40; -namespace Spine.Implementations.SpineWrappers.V40.Attachments +namespace Spine.Implementations.V40.Attachments { internal sealed class BoundingBoxAttachment40(BoundingBoxAttachment innerObject) : Attachment40(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V40.Attachments public override BoundingBoxAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot40 st) { diff --git a/Spine/Implementations/SpineWrappers/V40/Attachments/ClippingAttachment40.cs b/Spine/Implementations/V40/Attachments/ClippingAttachment40.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V40/Attachments/ClippingAttachment40.cs rename to Spine/Implementations/V40/Attachments/ClippingAttachment40.cs index 5ce1e20..63e095d 100644 --- a/Spine/Implementations/SpineWrappers/V40/Attachments/ClippingAttachment40.cs +++ b/Spine/Implementations/V40/Attachments/ClippingAttachment40.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V40; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime40; -namespace Spine.Implementations.SpineWrappers.V40.Attachments +namespace Spine.Implementations.V40.Attachments { internal sealed class ClippingAttachment40(ClippingAttachment innerObject) : Attachment40(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V40.Attachments public override ClippingAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot40 st) { diff --git a/Spine/Implementations/SpineWrappers/V40/Attachments/MeshAttachment40.cs b/Spine/Implementations/V40/Attachments/MeshAttachment40.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V40/Attachments/MeshAttachment40.cs rename to Spine/Implementations/V40/Attachments/MeshAttachment40.cs index d32f730..86e05b3 100644 --- a/Spine/Implementations/SpineWrappers/V40/Attachments/MeshAttachment40.cs +++ b/Spine/Implementations/V40/Attachments/MeshAttachment40.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V40; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime40; -namespace Spine.Implementations.SpineWrappers.V40.Attachments +namespace Spine.Implementations.V40.Attachments { internal sealed class MeshAttachment40(MeshAttachment innerObject) : Attachment40(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V40.Attachments public override MeshAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot40 st) { diff --git a/Spine/Implementations/SpineWrappers/V40/Attachments/PathAttachment40.cs b/Spine/Implementations/V40/Attachments/PathAttachment40.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V40/Attachments/PathAttachment40.cs rename to Spine/Implementations/V40/Attachments/PathAttachment40.cs index 7636c0f..2046048 100644 --- a/Spine/Implementations/SpineWrappers/V40/Attachments/PathAttachment40.cs +++ b/Spine/Implementations/V40/Attachments/PathAttachment40.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V40; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime40; -namespace Spine.Implementations.SpineWrappers.V40.Attachments +namespace Spine.Implementations.V40.Attachments { internal sealed class PathAttachment40(PathAttachment innerObject) : Attachment40(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V40.Attachments public override PathAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot40 st) { diff --git a/Spine/Implementations/SpineWrappers/V40/Attachments/PointAttachment40.cs b/Spine/Implementations/V40/Attachments/PointAttachment40.cs similarity index 78% rename from Spine/Implementations/SpineWrappers/V40/Attachments/PointAttachment40.cs rename to Spine/Implementations/V40/Attachments/PointAttachment40.cs index d844f82..74f6348 100644 --- a/Spine/Implementations/SpineWrappers/V40/Attachments/PointAttachment40.cs +++ b/Spine/Implementations/V40/Attachments/PointAttachment40.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V40; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime40; -namespace Spine.Implementations.SpineWrappers.V40.Attachments +namespace Spine.Implementations.V40.Attachments { internal sealed class PointAttachment40(PointAttachment innerObject) : Attachment40(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V40.Attachments public override PointAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot40 st) { diff --git a/Spine/Implementations/SpineWrappers/V40/Attachments/RegionAttachment40.cs b/Spine/Implementations/V40/Attachments/RegionAttachment40.cs similarity index 84% rename from Spine/Implementations/SpineWrappers/V40/Attachments/RegionAttachment40.cs rename to Spine/Implementations/V40/Attachments/RegionAttachment40.cs index e514c50..1d8d7b8 100644 --- a/Spine/Implementations/SpineWrappers/V40/Attachments/RegionAttachment40.cs +++ b/Spine/Implementations/V40/Attachments/RegionAttachment40.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V40; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime40; -namespace Spine.Implementations.SpineWrappers.V40.Attachments +namespace Spine.Implementations.V40.Attachments { internal sealed class RegionAttachment40(RegionAttachment innerObject) : Attachment40(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V40.Attachments public override RegionAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot40 st) { diff --git a/Spine/Implementations/SpineWrappers/V40/Bone40.cs b/Spine/Implementations/V40/Bone40.cs similarity index 91% rename from Spine/Implementations/SpineWrappers/V40/Bone40.cs rename to Spine/Implementations/V40/Bone40.cs index cfb8818..6fe2def 100644 --- a/Spine/Implementations/SpineWrappers/V40/Bone40.cs +++ b/Spine/Implementations/V40/Bone40.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime40; -namespace Spine.Implementations.SpineWrappers.V40 +namespace Spine.Implementations.V40 { internal sealed class Bone40(Bone innerObject, Bone40? parent = null) : IBone { diff --git a/Spine/Implementations/SpineWrappers/V40/Skeleton40.cs b/Spine/Implementations/V40/Skeleton40.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V40/Skeleton40.cs rename to Spine/Implementations/V40/Skeleton40.cs index ec4b055..38b4c16 100644 --- a/Spine/Implementations/SpineWrappers/V40/Skeleton40.cs +++ b/Spine/Implementations/V40/Skeleton40.cs @@ -5,10 +5,10 @@ using System.Text; using System.Threading.Tasks; using System.Collections.Frozen; using System.Collections.Immutable; -using Spine.SpineWrappers; using SpineRuntime40; +using Spine.Interfaces; -namespace Spine.Implementations.SpineWrappers.V40 +namespace Spine.Implementations.V40 { internal sealed class Skeleton40 : ISkeleton { @@ -95,12 +95,6 @@ namespace Spine.Implementations.SpineWrappers.V40 public void SetSlotsToSetupPose() => _o.SetSlotsToSetupPose(); public void Update(float delta) => _o.Update(delta); - public void GetBounds(out float x, out float y, out float w, out float h) - { - float[] _ = []; - _o.GetBounds(out x, out y, out w, out h, ref _); - } - public override string ToString() => _o.ToString(); } } diff --git a/Spine/Implementations/SpineWrappers/V40/SkeletonClipping40.cs b/Spine/Implementations/V40/SkeletonClipping40.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V40/SkeletonClipping40.cs rename to Spine/Implementations/V40/SkeletonClipping40.cs index ff334f9..0691d4c 100644 --- a/Spine/Implementations/SpineWrappers/V40/SkeletonClipping40.cs +++ b/Spine/Implementations/V40/SkeletonClipping40.cs @@ -1,5 +1,5 @@ -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using Spine.Utils; using SpineRuntime40; using System; @@ -8,7 +8,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V40 +namespace Spine.Implementations.V40 { internal sealed class SkeletonClipping40 : ISkeletonClipping { diff --git a/Spine/Implementations/SpineWrappers/V40/Skin40.cs b/Spine/Implementations/V40/Skin40.cs similarity index 92% rename from Spine/Implementations/SpineWrappers/V40/Skin40.cs rename to Spine/Implementations/V40/Skin40.cs index d656154..29bd14e 100644 --- a/Spine/Implementations/SpineWrappers/V40/Skin40.cs +++ b/Spine/Implementations/V40/Skin40.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime40; -namespace Spine.Implementations.SpineWrappers.V40 +namespace Spine.Implementations.V40 { internal sealed class Skin40 : ISkin { diff --git a/Spine/Implementations/SpineWrappers/V40/Slot40.cs b/Spine/Implementations/V40/Slot40.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V40/Slot40.cs rename to Spine/Implementations/V40/Slot40.cs index 14f703d..26e8ebe 100644 --- a/Spine/Implementations/SpineWrappers/V40/Slot40.cs +++ b/Spine/Implementations/V40/Slot40.cs @@ -5,10 +5,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; using SpineRuntime40; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V40 +namespace Spine.Implementations.V40 { internal sealed class Slot40 : ISlot { @@ -46,7 +47,7 @@ namespace Spine.Implementations.SpineWrappers.V40 public float A { get => _o.A; set => _o.A = value; } public IBone Bone => _bone; - public Spine.SpineWrappers.Attachments.IAttachment? Attachment + public IAttachment? Attachment { get { diff --git a/Spine/Implementations/SpineWrappers/V40/SpineObjectData40.cs b/Spine/Implementations/V40/SpineObjectData40.cs similarity index 96% rename from Spine/Implementations/SpineWrappers/V40/SpineObjectData40.cs rename to Spine/Implementations/V40/SpineObjectData40.cs index 6014619..b02a489 100644 --- a/Spine/Implementations/SpineWrappers/V40/SpineObjectData40.cs +++ b/Spine/Implementations/V40/SpineObjectData40.cs @@ -6,12 +6,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; using SpineRuntime40; -using Spine.Implementations.SpineWrappers.V40.Attachments; +using Spine.Implementations.V40.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V40 +namespace Spine.Implementations.V40 { [SpineImplementation(4, 0)] internal sealed class SpineObjectData40 : SpineObjectData @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V40 private readonly ImmutableArray _animations; private readonly FrozenDictionary _animationsByName; - public SpineObjectData40(string skelPath, string atlasPath, Spine.SpineWrappers.TextureLoader textureLoader) + public SpineObjectData40(string skelPath, string atlasPath, TextureLoader textureLoader) : base(skelPath, atlasPath, textureLoader) { // 加载 atlas diff --git a/Spine/Implementations/SpineWrappers/V40/TrackEntry40.cs b/Spine/Implementations/V40/TrackEntry40.cs similarity index 90% rename from Spine/Implementations/SpineWrappers/V40/TrackEntry40.cs rename to Spine/Implementations/V40/TrackEntry40.cs index 8fe5cda..a407d09 100644 --- a/Spine/Implementations/SpineWrappers/V40/TrackEntry40.cs +++ b/Spine/Implementations/V40/TrackEntry40.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime40; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V40 +namespace Spine.Implementations.V40 { internal sealed class TrackEntry40(TrackEntry innerObject, AnimationState40 animationState, SpineObjectData40 data): ITrackEntry { @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V40 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -55,7 +55,7 @@ namespace Spine.Implementations.SpineWrappers.V40 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Interrupt += f; @@ -84,7 +84,7 @@ namespace Spine.Implementations.SpineWrappers.V40 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -113,7 +113,7 @@ namespace Spine.Implementations.SpineWrappers.V40 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; @@ -142,7 +142,7 @@ namespace Spine.Implementations.SpineWrappers.V40 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Dispose += f; diff --git a/Spine/Implementations/SpineWrappers/V41/Animation41.cs b/Spine/Implementations/V41/Animation41.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V41/Animation41.cs rename to Spine/Implementations/V41/Animation41.cs index 928bab4..085442f 100644 --- a/Spine/Implementations/SpineWrappers/V41/Animation41.cs +++ b/Spine/Implementations/V41/Animation41.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime41; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V41 +namespace Spine.Implementations.V41 { internal sealed class Animation41(Animation innerObject) : IAnimation { diff --git a/Spine/Implementations/SpineWrappers/V41/AnimationState41.cs b/Spine/Implementations/V41/AnimationState41.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V41/AnimationState41.cs rename to Spine/Implementations/V41/AnimationState41.cs index e5b658a..d76f7d8 100644 --- a/Spine/Implementations/SpineWrappers/V41/AnimationState41.cs +++ b/Spine/Implementations/V41/AnimationState41.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime41; -namespace Spine.Implementations.SpineWrappers.V41 +namespace Spine.Implementations.V41 { internal sealed class AnimationState41(AnimationState innerObject, SpineObjectData41 data) : IAnimationState { @@ -27,7 +27,7 @@ namespace Spine.Implementations.SpineWrappers.V41 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -56,7 +56,7 @@ namespace Spine.Implementations.SpineWrappers.V41 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Interrupt += f; @@ -85,7 +85,7 @@ namespace Spine.Implementations.SpineWrappers.V41 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -114,7 +114,7 @@ namespace Spine.Implementations.SpineWrappers.V41 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; @@ -143,7 +143,7 @@ namespace Spine.Implementations.SpineWrappers.V41 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Dispose += f; diff --git a/Spine/Implementations/SpineWrappers/V41/Attachments/Attachment41.cs b/Spine/Implementations/V41/Attachments/Attachment41.cs similarity index 80% rename from Spine/Implementations/SpineWrappers/V41/Attachments/Attachment41.cs rename to Spine/Implementations/V41/Attachments/Attachment41.cs index 2b0c6c2..9897103 100644 --- a/Spine/Implementations/SpineWrappers/V41/Attachments/Attachment41.cs +++ b/Spine/Implementations/V41/Attachments/Attachment41.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime41; -namespace Spine.Implementations.SpineWrappers.V41.Attachments +namespace Spine.Implementations.V41.Attachments { internal abstract class Attachment41(Attachment innerObject) : IAttachment { diff --git a/Spine/Implementations/SpineWrappers/V41/Attachments/BoundingBoxAttachment41.cs b/Spine/Implementations/V41/Attachments/BoundingBoxAttachment41.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V41/Attachments/BoundingBoxAttachment41.cs rename to Spine/Implementations/V41/Attachments/BoundingBoxAttachment41.cs index 9ce42b7..534b2dc 100644 --- a/Spine/Implementations/SpineWrappers/V41/Attachments/BoundingBoxAttachment41.cs +++ b/Spine/Implementations/V41/Attachments/BoundingBoxAttachment41.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V41; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime41; -namespace Spine.Implementations.SpineWrappers.V41.Attachments +namespace Spine.Implementations.V41.Attachments { internal sealed class BoundingBoxAttachment41(BoundingBoxAttachment innerObject) : Attachment41(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V41.Attachments public override BoundingBoxAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot41 st) { diff --git a/Spine/Implementations/SpineWrappers/V41/Attachments/ClippingAttachment41.cs b/Spine/Implementations/V41/Attachments/ClippingAttachment41.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V41/Attachments/ClippingAttachment41.cs rename to Spine/Implementations/V41/Attachments/ClippingAttachment41.cs index 4b97e3b..d5db2d0 100644 --- a/Spine/Implementations/SpineWrappers/V41/Attachments/ClippingAttachment41.cs +++ b/Spine/Implementations/V41/Attachments/ClippingAttachment41.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V41; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime41; -namespace Spine.Implementations.SpineWrappers.V41.Attachments +namespace Spine.Implementations.V41.Attachments { internal sealed class ClippingAttachment41(ClippingAttachment innerObject) : Attachment41(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V41.Attachments public override ClippingAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot41 st) { diff --git a/Spine/Implementations/SpineWrappers/V41/Attachments/MeshAttachment41.cs b/Spine/Implementations/V41/Attachments/MeshAttachment41.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V41/Attachments/MeshAttachment41.cs rename to Spine/Implementations/V41/Attachments/MeshAttachment41.cs index 187e3a7..fddb477 100644 --- a/Spine/Implementations/SpineWrappers/V41/Attachments/MeshAttachment41.cs +++ b/Spine/Implementations/V41/Attachments/MeshAttachment41.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V41; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime41; -namespace Spine.Implementations.SpineWrappers.V41.Attachments +namespace Spine.Implementations.V41.Attachments { internal sealed class MeshAttachment41(MeshAttachment innerObject) : Attachment41(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V41.Attachments public override MeshAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot41 st) { diff --git a/Spine/Implementations/SpineWrappers/V41/Attachments/PathAttachment41.cs b/Spine/Implementations/V41/Attachments/PathAttachment41.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V41/Attachments/PathAttachment41.cs rename to Spine/Implementations/V41/Attachments/PathAttachment41.cs index 4f03609..36d6881 100644 --- a/Spine/Implementations/SpineWrappers/V41/Attachments/PathAttachment41.cs +++ b/Spine/Implementations/V41/Attachments/PathAttachment41.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V41; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime41; -namespace Spine.Implementations.SpineWrappers.V41.Attachments +namespace Spine.Implementations.V41.Attachments { internal sealed class PathAttachment41(PathAttachment innerObject) : Attachment41(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V41.Attachments public override PathAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot41 st) { diff --git a/Spine/Implementations/SpineWrappers/V41/Attachments/PointAttachment41.cs b/Spine/Implementations/V41/Attachments/PointAttachment41.cs similarity index 78% rename from Spine/Implementations/SpineWrappers/V41/Attachments/PointAttachment41.cs rename to Spine/Implementations/V41/Attachments/PointAttachment41.cs index 27ebbcf..1283c01 100644 --- a/Spine/Implementations/SpineWrappers/V41/Attachments/PointAttachment41.cs +++ b/Spine/Implementations/V41/Attachments/PointAttachment41.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V41; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime41; -namespace Spine.Implementations.SpineWrappers.V41.Attachments +namespace Spine.Implementations.V41.Attachments { internal sealed class PointAttachment41(PointAttachment innerObject) : Attachment41(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V41.Attachments public override PointAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot41 st) { diff --git a/Spine/Implementations/SpineWrappers/V41/Attachments/RegionAttachment41.cs b/Spine/Implementations/V41/Attachments/RegionAttachment41.cs similarity index 84% rename from Spine/Implementations/SpineWrappers/V41/Attachments/RegionAttachment41.cs rename to Spine/Implementations/V41/Attachments/RegionAttachment41.cs index d61f43d..56f934f 100644 --- a/Spine/Implementations/SpineWrappers/V41/Attachments/RegionAttachment41.cs +++ b/Spine/Implementations/V41/Attachments/RegionAttachment41.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V41; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime41; -namespace Spine.Implementations.SpineWrappers.V41.Attachments +namespace Spine.Implementations.V41.Attachments { internal sealed class RegionAttachment41(RegionAttachment innerObject) : Attachment41(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V41.Attachments public override RegionAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot41 st) { diff --git a/Spine/Implementations/SpineWrappers/V41/Bone41.cs b/Spine/Implementations/V41/Bone41.cs similarity index 91% rename from Spine/Implementations/SpineWrappers/V41/Bone41.cs rename to Spine/Implementations/V41/Bone41.cs index 25a45cc..dedff12 100644 --- a/Spine/Implementations/SpineWrappers/V41/Bone41.cs +++ b/Spine/Implementations/V41/Bone41.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime41; -namespace Spine.Implementations.SpineWrappers.V41 +namespace Spine.Implementations.V41 { internal sealed class Bone41(Bone innerObject, Bone41? parent = null) : IBone { diff --git a/Spine/Implementations/SpineWrappers/V41/Skeleton41.cs b/Spine/Implementations/V41/Skeleton41.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V41/Skeleton41.cs rename to Spine/Implementations/V41/Skeleton41.cs index 994139a..cf3187f 100644 --- a/Spine/Implementations/SpineWrappers/V41/Skeleton41.cs +++ b/Spine/Implementations/V41/Skeleton41.cs @@ -5,10 +5,10 @@ using System.Text; using System.Threading.Tasks; using System.Collections.Frozen; using System.Collections.Immutable; -using Spine.SpineWrappers; using SpineRuntime41; +using Spine.Interfaces; -namespace Spine.Implementations.SpineWrappers.V41 +namespace Spine.Implementations.V41 { internal sealed class Skeleton41 : ISkeleton { @@ -95,12 +95,6 @@ namespace Spine.Implementations.SpineWrappers.V41 public void SetSlotsToSetupPose() => _o.SetSlotsToSetupPose(); public void Update(float delta) { } // 4.1 没有 Update 方法 - public void GetBounds(out float x, out float y, out float w, out float h) - { - float[] _ = []; - _o.GetBounds(out x, out y, out w, out h, ref _); - } - public override string ToString() => _o.ToString(); } } diff --git a/Spine/Implementations/SpineWrappers/V41/SkeletonClipping41.cs b/Spine/Implementations/V41/SkeletonClipping41.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V41/SkeletonClipping41.cs rename to Spine/Implementations/V41/SkeletonClipping41.cs index b9714fb..1d7f74c 100644 --- a/Spine/Implementations/SpineWrappers/V41/SkeletonClipping41.cs +++ b/Spine/Implementations/V41/SkeletonClipping41.cs @@ -1,5 +1,5 @@ -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using Spine.Utils; using SpineRuntime41; using System; @@ -8,7 +8,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V41 +namespace Spine.Implementations.V41 { internal sealed class SkeletonClipping41 : ISkeletonClipping { diff --git a/Spine/Implementations/SpineWrappers/V41/Skin41.cs b/Spine/Implementations/V41/Skin41.cs similarity index 92% rename from Spine/Implementations/SpineWrappers/V41/Skin41.cs rename to Spine/Implementations/V41/Skin41.cs index b5acacf..686edb4 100644 --- a/Spine/Implementations/SpineWrappers/V41/Skin41.cs +++ b/Spine/Implementations/V41/Skin41.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime41; -namespace Spine.Implementations.SpineWrappers.V41 +namespace Spine.Implementations.V41 { internal sealed class Skin41 : ISkin { diff --git a/Spine/Implementations/SpineWrappers/V41/Slot41.cs b/Spine/Implementations/V41/Slot41.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V41/Slot41.cs rename to Spine/Implementations/V41/Slot41.cs index 9ddd689..58f3037 100644 --- a/Spine/Implementations/SpineWrappers/V41/Slot41.cs +++ b/Spine/Implementations/V41/Slot41.cs @@ -5,10 +5,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; using SpineRuntime41; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V41 +namespace Spine.Implementations.V41 { internal sealed class Slot41 : ISlot { @@ -46,7 +47,7 @@ namespace Spine.Implementations.SpineWrappers.V41 public float A { get => _o.A; set => _o.A = value; } public IBone Bone => _bone; - public Spine.SpineWrappers.Attachments.IAttachment? Attachment + public IAttachment? Attachment { get { diff --git a/Spine/Implementations/SpineWrappers/V41/SpineObjectData41.cs b/Spine/Implementations/V41/SpineObjectData41.cs similarity index 96% rename from Spine/Implementations/SpineWrappers/V41/SpineObjectData41.cs rename to Spine/Implementations/V41/SpineObjectData41.cs index 259655f..25ede0d 100644 --- a/Spine/Implementations/SpineWrappers/V41/SpineObjectData41.cs +++ b/Spine/Implementations/V41/SpineObjectData41.cs @@ -6,12 +6,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; using SpineRuntime41; -using Spine.Implementations.SpineWrappers.V41.Attachments; +using Spine.Implementations.V41.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V41 +namespace Spine.Implementations.V41 { [SpineImplementation(4, 1)] internal sealed class SpineObjectData41 : SpineObjectData @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V41 private readonly ImmutableArray _animations; private readonly FrozenDictionary _animationsByName; - public SpineObjectData41(string skelPath, string atlasPath, Spine.SpineWrappers.TextureLoader textureLoader) + public SpineObjectData41(string skelPath, string atlasPath, TextureLoader textureLoader) : base(skelPath, atlasPath, textureLoader) { // 加载 atlas diff --git a/Spine/Implementations/SpineWrappers/V41/TrackEntry41.cs b/Spine/Implementations/V41/TrackEntry41.cs similarity index 90% rename from Spine/Implementations/SpineWrappers/V41/TrackEntry41.cs rename to Spine/Implementations/V41/TrackEntry41.cs index ca359a7..db75f63 100644 --- a/Spine/Implementations/SpineWrappers/V41/TrackEntry41.cs +++ b/Spine/Implementations/V41/TrackEntry41.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime41; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V41 +namespace Spine.Implementations.V41 { internal sealed class TrackEntry41(TrackEntry innerObject, AnimationState41 animationState, SpineObjectData41 data): ITrackEntry { @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V41 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -55,7 +55,7 @@ namespace Spine.Implementations.SpineWrappers.V41 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Interrupt += f; @@ -84,7 +84,7 @@ namespace Spine.Implementations.SpineWrappers.V41 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -113,7 +113,7 @@ namespace Spine.Implementations.SpineWrappers.V41 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; @@ -142,7 +142,7 @@ namespace Spine.Implementations.SpineWrappers.V41 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Dispose += f; diff --git a/Spine/Implementations/SpineWrappers/V42/Animation42.cs b/Spine/Implementations/V42/Animation42.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V42/Animation42.cs rename to Spine/Implementations/V42/Animation42.cs index d16e0db..58bbe57 100644 --- a/Spine/Implementations/SpineWrappers/V42/Animation42.cs +++ b/Spine/Implementations/V42/Animation42.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime42; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V42 +namespace Spine.Implementations.V42 { internal sealed class Animation42(Animation innerObject) : IAnimation { diff --git a/Spine/Implementations/SpineWrappers/V42/AnimationState42.cs b/Spine/Implementations/V42/AnimationState42.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V42/AnimationState42.cs rename to Spine/Implementations/V42/AnimationState42.cs index 9909848..0e8b046 100644 --- a/Spine/Implementations/SpineWrappers/V42/AnimationState42.cs +++ b/Spine/Implementations/V42/AnimationState42.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime42; -namespace Spine.Implementations.SpineWrappers.V42 +namespace Spine.Implementations.V42 { internal sealed class AnimationState42(AnimationState innerObject, SpineObjectData42 data) : IAnimationState { @@ -27,7 +27,7 @@ namespace Spine.Implementations.SpineWrappers.V42 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -56,7 +56,7 @@ namespace Spine.Implementations.SpineWrappers.V42 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Interrupt += f; @@ -85,7 +85,7 @@ namespace Spine.Implementations.SpineWrappers.V42 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -114,7 +114,7 @@ namespace Spine.Implementations.SpineWrappers.V42 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; @@ -143,7 +143,7 @@ namespace Spine.Implementations.SpineWrappers.V42 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(GetTrackEntry(t)); _eventCount[value] = 0; } _o.Dispose += f; diff --git a/Spine/Implementations/SpineWrappers/V42/Attachments/Attachment42.cs b/Spine/Implementations/V42/Attachments/Attachment42.cs similarity index 80% rename from Spine/Implementations/SpineWrappers/V42/Attachments/Attachment42.cs rename to Spine/Implementations/V42/Attachments/Attachment42.cs index 9ab0208..c3596bd 100644 --- a/Spine/Implementations/SpineWrappers/V42/Attachments/Attachment42.cs +++ b/Spine/Implementations/V42/Attachments/Attachment42.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime42; -namespace Spine.Implementations.SpineWrappers.V42.Attachments +namespace Spine.Implementations.V42.Attachments { internal abstract class Attachment42(Attachment innerObject) : IAttachment { diff --git a/Spine/Implementations/SpineWrappers/V42/Attachments/BoundingBoxAttachment42.cs b/Spine/Implementations/V42/Attachments/BoundingBoxAttachment42.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V42/Attachments/BoundingBoxAttachment42.cs rename to Spine/Implementations/V42/Attachments/BoundingBoxAttachment42.cs index 9b15c9b..b823588 100644 --- a/Spine/Implementations/SpineWrappers/V42/Attachments/BoundingBoxAttachment42.cs +++ b/Spine/Implementations/V42/Attachments/BoundingBoxAttachment42.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V42; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime42; -namespace Spine.Implementations.SpineWrappers.V42.Attachments +namespace Spine.Implementations.V42.Attachments { internal sealed class BoundingBoxAttachment42(BoundingBoxAttachment innerObject) : Attachment42(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V42.Attachments public override BoundingBoxAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot42 st) { diff --git a/Spine/Implementations/SpineWrappers/V42/Attachments/ClippingAttachment42.cs b/Spine/Implementations/V42/Attachments/ClippingAttachment42.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V42/Attachments/ClippingAttachment42.cs rename to Spine/Implementations/V42/Attachments/ClippingAttachment42.cs index c6430df..9bebfb3 100644 --- a/Spine/Implementations/SpineWrappers/V42/Attachments/ClippingAttachment42.cs +++ b/Spine/Implementations/V42/Attachments/ClippingAttachment42.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V42; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime42; -namespace Spine.Implementations.SpineWrappers.V42.Attachments +namespace Spine.Implementations.V42.Attachments { internal sealed class ClippingAttachment42(ClippingAttachment innerObject) : Attachment42(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V42.Attachments public override ClippingAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot42 st) { diff --git a/Spine/Implementations/SpineWrappers/V42/Attachments/MeshAttachment42.cs b/Spine/Implementations/V42/Attachments/MeshAttachment42.cs similarity index 85% rename from Spine/Implementations/SpineWrappers/V42/Attachments/MeshAttachment42.cs rename to Spine/Implementations/V42/Attachments/MeshAttachment42.cs index 93b230e..f635061 100644 --- a/Spine/Implementations/SpineWrappers/V42/Attachments/MeshAttachment42.cs +++ b/Spine/Implementations/V42/Attachments/MeshAttachment42.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V42; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime42; -namespace Spine.Implementations.SpineWrappers.V42.Attachments +namespace Spine.Implementations.V42.Attachments { internal sealed class MeshAttachment42(MeshAttachment innerObject) : Attachment42(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V42.Attachments public override MeshAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot42 st) { diff --git a/Spine/Implementations/SpineWrappers/V42/Attachments/PathAttachment42.cs b/Spine/Implementations/V42/Attachments/PathAttachment42.cs similarity index 79% rename from Spine/Implementations/SpineWrappers/V42/Attachments/PathAttachment42.cs rename to Spine/Implementations/V42/Attachments/PathAttachment42.cs index af80ae1..b8d5f0b 100644 --- a/Spine/Implementations/SpineWrappers/V42/Attachments/PathAttachment42.cs +++ b/Spine/Implementations/V42/Attachments/PathAttachment42.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V42; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime42; -namespace Spine.Implementations.SpineWrappers.V42.Attachments +namespace Spine.Implementations.V42.Attachments { internal sealed class PathAttachment42(PathAttachment innerObject) : Attachment42(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V42.Attachments public override PathAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot42 st) { diff --git a/Spine/Implementations/SpineWrappers/V42/Attachments/PointAttachment42.cs b/Spine/Implementations/V42/Attachments/PointAttachment42.cs similarity index 78% rename from Spine/Implementations/SpineWrappers/V42/Attachments/PointAttachment42.cs rename to Spine/Implementations/V42/Attachments/PointAttachment42.cs index 2570f55..204baa2 100644 --- a/Spine/Implementations/SpineWrappers/V42/Attachments/PointAttachment42.cs +++ b/Spine/Implementations/V42/Attachments/PointAttachment42.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V42; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime42; -namespace Spine.Implementations.SpineWrappers.V42.Attachments +namespace Spine.Implementations.V42.Attachments { internal sealed class PointAttachment42(PointAttachment innerObject) : Attachment42(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V42.Attachments public override PointAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot42 st) { diff --git a/Spine/Implementations/SpineWrappers/V42/Attachments/RegionAttachment42.cs b/Spine/Implementations/V42/Attachments/RegionAttachment42.cs similarity index 84% rename from Spine/Implementations/SpineWrappers/V42/Attachments/RegionAttachment42.cs rename to Spine/Implementations/V42/Attachments/RegionAttachment42.cs index 9f3c762..364b205 100644 --- a/Spine/Implementations/SpineWrappers/V42/Attachments/RegionAttachment42.cs +++ b/Spine/Implementations/V42/Attachments/RegionAttachment42.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations.V42; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using SpineRuntime42; -namespace Spine.Implementations.SpineWrappers.V42.Attachments +namespace Spine.Implementations.V42.Attachments { internal sealed class RegionAttachment42(RegionAttachment innerObject) : Attachment42(innerObject), @@ -16,7 +18,7 @@ namespace Spine.Implementations.SpineWrappers.V42.Attachments public override RegionAttachment InnerObject => _o; - public override int ComputeWorldVertices(Spine.SpineWrappers.ISlot slot, ref float[] worldVertices) + public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices) { if (slot is Slot42 st) { diff --git a/Spine/Implementations/SpineWrappers/V42/Bone42.cs b/Spine/Implementations/V42/Bone42.cs similarity index 91% rename from Spine/Implementations/SpineWrappers/V42/Bone42.cs rename to Spine/Implementations/V42/Bone42.cs index 5525eb7..ad203d1 100644 --- a/Spine/Implementations/SpineWrappers/V42/Bone42.cs +++ b/Spine/Implementations/V42/Bone42.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime42; -namespace Spine.Implementations.SpineWrappers.V42 +namespace Spine.Implementations.V42 { internal sealed class Bone42(Bone innerObject, Bone42? parent = null) : IBone { diff --git a/Spine/Implementations/SpineWrappers/V42/Skeleton42.cs b/Spine/Implementations/V42/Skeleton42.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V42/Skeleton42.cs rename to Spine/Implementations/V42/Skeleton42.cs index 9866c1c..a69434c 100644 --- a/Spine/Implementations/SpineWrappers/V42/Skeleton42.cs +++ b/Spine/Implementations/V42/Skeleton42.cs @@ -5,10 +5,10 @@ using System.Text; using System.Threading.Tasks; using System.Collections.Frozen; using System.Collections.Immutable; -using Spine.SpineWrappers; using SpineRuntime42; +using Spine.Interfaces; -namespace Spine.Implementations.SpineWrappers.V42 +namespace Spine.Implementations.V42 { internal sealed class Skeleton42 : ISkeleton { @@ -103,12 +103,6 @@ namespace Spine.Implementations.SpineWrappers.V42 public void SetSlotsToSetupPose() => _o.SetSlotsToSetupPose(); public void Update(float delta) => _o.Update(delta); - public void GetBounds(out float x, out float y, out float w, out float h) - { - float[] _ = []; - _o.GetBounds(out x, out y, out w, out h, ref _); - } - public override string ToString() => _o.ToString(); } } diff --git a/Spine/Implementations/SpineWrappers/V42/SkeletonClipping42.cs b/Spine/Implementations/V42/SkeletonClipping42.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V42/SkeletonClipping42.cs rename to Spine/Implementations/V42/SkeletonClipping42.cs index d4763d7..cf47204 100644 --- a/Spine/Implementations/SpineWrappers/V42/SkeletonClipping42.cs +++ b/Spine/Implementations/V42/SkeletonClipping42.cs @@ -1,5 +1,5 @@ -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using Spine.Utils; using SpineRuntime42; using System; @@ -8,7 +8,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V42 +namespace Spine.Implementations.V42 { internal sealed class SkeletonClipping42 : ISkeletonClipping { diff --git a/Spine/Implementations/SpineWrappers/V42/Skin42.cs b/Spine/Implementations/V42/Skin42.cs similarity index 92% rename from Spine/Implementations/SpineWrappers/V42/Skin42.cs rename to Spine/Implementations/V42/Skin42.cs index 560039e..337e2d5 100644 --- a/Spine/Implementations/SpineWrappers/V42/Skin42.cs +++ b/Spine/Implementations/V42/Skin42.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime42; -namespace Spine.Implementations.SpineWrappers.V42 +namespace Spine.Implementations.V42 { internal sealed class Skin42 : ISkin { diff --git a/Spine/Implementations/SpineWrappers/V42/Slot42.cs b/Spine/Implementations/V42/Slot42.cs similarity index 93% rename from Spine/Implementations/SpineWrappers/V42/Slot42.cs rename to Spine/Implementations/V42/Slot42.cs index 283c011..f27af17 100644 --- a/Spine/Implementations/SpineWrappers/V42/Slot42.cs +++ b/Spine/Implementations/V42/Slot42.cs @@ -5,10 +5,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; using SpineRuntime42; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V42 +namespace Spine.Implementations.V42 { internal sealed class Slot42 : ISlot { @@ -46,7 +47,7 @@ namespace Spine.Implementations.SpineWrappers.V42 public float A { get => _o.A; set => _o.A = value; } public IBone Bone => _bone; - public Spine.SpineWrappers.Attachments.IAttachment? Attachment + public IAttachment? Attachment { get { diff --git a/Spine/Implementations/SpineWrappers/V42/SpineObjectData42.cs b/Spine/Implementations/V42/SpineObjectData42.cs similarity index 96% rename from Spine/Implementations/SpineWrappers/V42/SpineObjectData42.cs rename to Spine/Implementations/V42/SpineObjectData42.cs index fb1d19f..95afa35 100644 --- a/Spine/Implementations/SpineWrappers/V42/SpineObjectData42.cs +++ b/Spine/Implementations/V42/SpineObjectData42.cs @@ -6,12 +6,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Spine.Utils; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; using SpineRuntime42; -using Spine.Implementations.SpineWrappers.V42.Attachments; +using Spine.Implementations.V42.Attachments; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; -namespace Spine.Implementations.SpineWrappers.V42 +namespace Spine.Implementations.V42 { [SpineImplementation(4, 2)] internal sealed class SpineObjectData42 : SpineObjectData @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V42 private readonly ImmutableArray _animations; private readonly FrozenDictionary _animationsByName; - public SpineObjectData42(string skelPath, string atlasPath, Spine.SpineWrappers.TextureLoader textureLoader) + public SpineObjectData42(string skelPath, string atlasPath, TextureLoader textureLoader) : base(skelPath, atlasPath, textureLoader) { // 加载 atlas diff --git a/Spine/Implementations/SpineWrappers/V42/TrackEntry42.cs b/Spine/Implementations/V42/TrackEntry42.cs similarity index 90% rename from Spine/Implementations/SpineWrappers/V42/TrackEntry42.cs rename to Spine/Implementations/V42/TrackEntry42.cs index 5c8e9d6..9ebe9f0 100644 --- a/Spine/Implementations/SpineWrappers/V42/TrackEntry42.cs +++ b/Spine/Implementations/V42/TrackEntry42.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineRuntime42; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.Implementations.SpineWrappers.V42 +namespace Spine.Implementations.V42 { internal sealed class TrackEntry42(TrackEntry innerObject, AnimationState42 animationState, SpineObjectData42 data): ITrackEntry { @@ -26,7 +26,7 @@ namespace Spine.Implementations.SpineWrappers.V42 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Start += f; @@ -55,7 +55,7 @@ namespace Spine.Implementations.SpineWrappers.V42 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Interrupt += f; @@ -84,7 +84,7 @@ namespace Spine.Implementations.SpineWrappers.V42 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.End += f; @@ -113,7 +113,7 @@ namespace Spine.Implementations.SpineWrappers.V42 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Complete += f; @@ -142,7 +142,7 @@ namespace Spine.Implementations.SpineWrappers.V42 if (value is null) return; if (!_eventMapping.TryGetValue(value, out var f)) { - _eventMapping[value] = f = (TrackEntry t) => value(_animationState.GetTrackEntry(t)); + _eventMapping[value] = f = (t) => value(_animationState.GetTrackEntry(t)); _eventCount[value] = 0; } _o.Dispose += f; diff --git a/Spine/SpineWrappers/Attachments/IAttachment.cs b/Spine/Interfaces/Attachments/IAttachment.cs similarity index 90% rename from Spine/SpineWrappers/Attachments/IAttachment.cs rename to Spine/Interfaces/Attachments/IAttachment.cs index 31a42d5..3b661fe 100644 --- a/Spine/SpineWrappers/Attachments/IAttachment.cs +++ b/Spine/Interfaces/Attachments/IAttachment.cs @@ -1,10 +1,11 @@ -using System; +using Spine.Interfaces; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers.Attachments +namespace Spine.Interfaces.Attachments { public interface IAttachment { diff --git a/Spine/SpineWrappers/Attachments/IBoundingBoxAttachment.cs b/Spine/Interfaces/Attachments/IBoundingBoxAttachment.cs similarity index 82% rename from Spine/SpineWrappers/Attachments/IBoundingBoxAttachment.cs rename to Spine/Interfaces/Attachments/IBoundingBoxAttachment.cs index 8c702bb..7b618d4 100644 --- a/Spine/SpineWrappers/Attachments/IBoundingBoxAttachment.cs +++ b/Spine/Interfaces/Attachments/IBoundingBoxAttachment.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers.Attachments +namespace Spine.Interfaces.Attachments { public interface IBoundingBoxAttachment : IAttachment { diff --git a/Spine/SpineWrappers/Attachments/IClippingAttachment.cs b/Spine/Interfaces/Attachments/IClippingAttachment.cs similarity index 82% rename from Spine/SpineWrappers/Attachments/IClippingAttachment.cs rename to Spine/Interfaces/Attachments/IClippingAttachment.cs index dbc0880..331ffe8 100644 --- a/Spine/SpineWrappers/Attachments/IClippingAttachment.cs +++ b/Spine/Interfaces/Attachments/IClippingAttachment.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers.Attachments +namespace Spine.Interfaces.Attachments { public interface IClippingAttachment : IAttachment { diff --git a/Spine/SpineWrappers/Attachments/IMeshAttachment.cs b/Spine/Interfaces/Attachments/IMeshAttachment.cs similarity index 94% rename from Spine/SpineWrappers/Attachments/IMeshAttachment.cs rename to Spine/Interfaces/Attachments/IMeshAttachment.cs index 13ee207..d4462fd 100644 --- a/Spine/SpineWrappers/Attachments/IMeshAttachment.cs +++ b/Spine/Interfaces/Attachments/IMeshAttachment.cs @@ -1,10 +1,11 @@ -using System; +using Spine.Interfaces; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers.Attachments +namespace Spine.Interfaces.Attachments { public interface IMeshAttachment : IAttachment { diff --git a/Spine/SpineWrappers/Attachments/IPathAttachment.cs b/Spine/Interfaces/Attachments/IPathAttachment.cs similarity index 81% rename from Spine/SpineWrappers/Attachments/IPathAttachment.cs rename to Spine/Interfaces/Attachments/IPathAttachment.cs index 8c7ff2c..8bb4128 100644 --- a/Spine/SpineWrappers/Attachments/IPathAttachment.cs +++ b/Spine/Interfaces/Attachments/IPathAttachment.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers.Attachments +namespace Spine.Interfaces.Attachments { public interface IPathAttachment : IAttachment { diff --git a/Spine/SpineWrappers/Attachments/IPointAttachment.cs b/Spine/Interfaces/Attachments/IPointAttachment.cs similarity index 81% rename from Spine/SpineWrappers/Attachments/IPointAttachment.cs rename to Spine/Interfaces/Attachments/IPointAttachment.cs index a68a3ab..1217609 100644 --- a/Spine/SpineWrappers/Attachments/IPointAttachment.cs +++ b/Spine/Interfaces/Attachments/IPointAttachment.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers.Attachments +namespace Spine.Interfaces.Attachments { public interface IPointAttachment : IAttachment { diff --git a/Spine/SpineWrappers/Attachments/IRegionAttachment.cs b/Spine/Interfaces/Attachments/IRegionAttachment.cs similarity index 94% rename from Spine/SpineWrappers/Attachments/IRegionAttachment.cs rename to Spine/Interfaces/Attachments/IRegionAttachment.cs index c9e64d4..12c9412 100644 --- a/Spine/SpineWrappers/Attachments/IRegionAttachment.cs +++ b/Spine/Interfaces/Attachments/IRegionAttachment.cs @@ -1,10 +1,11 @@ -using System; +using Spine.Interfaces; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers.Attachments +namespace Spine.Interfaces.Attachments { public interface IRegionAttachment : IAttachment { diff --git a/Spine/SpineWrappers/Attachments/ISkinnedMeshAttachment.cs b/Spine/Interfaces/Attachments/ISkinnedMeshAttachment.cs similarity index 94% rename from Spine/SpineWrappers/Attachments/ISkinnedMeshAttachment.cs rename to Spine/Interfaces/Attachments/ISkinnedMeshAttachment.cs index a54c276..169e535 100644 --- a/Spine/SpineWrappers/Attachments/ISkinnedMeshAttachment.cs +++ b/Spine/Interfaces/Attachments/ISkinnedMeshAttachment.cs @@ -1,10 +1,11 @@ -using System; +using Spine.Interfaces; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers.Attachments +namespace Spine.Interfaces.Attachments { public interface ISkinnedMeshAttachment : IAttachment { diff --git a/Spine/SpineWrappers/IAnimation.cs b/Spine/Interfaces/IAnimation.cs similarity index 92% rename from Spine/SpineWrappers/IAnimation.cs rename to Spine/Interfaces/IAnimation.cs index 9dd8858..2062833 100644 --- a/Spine/SpineWrappers/IAnimation.cs +++ b/Spine/Interfaces/IAnimation.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers +namespace Spine.Interfaces { public interface IAnimation { diff --git a/Spine/SpineWrappers/IAnimationState.cs b/Spine/Interfaces/IAnimationState.cs similarity index 99% rename from Spine/SpineWrappers/IAnimationState.cs rename to Spine/Interfaces/IAnimationState.cs index 94c4c0f..edea63e 100644 --- a/Spine/SpineWrappers/IAnimationState.cs +++ b/Spine/Interfaces/IAnimationState.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers +namespace Spine.Interfaces { public interface IAnimationState { diff --git a/Spine/SpineWrappers/IBone.cs b/Spine/Interfaces/IBone.cs similarity index 97% rename from Spine/SpineWrappers/IBone.cs rename to Spine/Interfaces/IBone.cs index e8dea1c..05fa220 100644 --- a/Spine/SpineWrappers/IBone.cs +++ b/Spine/Interfaces/IBone.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers +namespace Spine.Interfaces { public interface IBone { diff --git a/Spine/SpineWrappers/ISkeleton.cs b/Spine/Interfaces/ISkeleton.cs similarity index 93% rename from Spine/SpineWrappers/ISkeleton.cs rename to Spine/Interfaces/ISkeleton.cs index 4ad2dad..d2cc362 100644 --- a/Spine/SpineWrappers/ISkeleton.cs +++ b/Spine/Interfaces/ISkeleton.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers +namespace Spine.Interfaces { public interface ISkeleton { @@ -114,10 +114,5 @@ namespace Spine.SpineWrappers /// 更新时间 /// public void Update(float delta); - - /// - /// 获取当前状态包围盒 - /// - public void GetBounds(out float x, out float y, out float w, out float h); } } diff --git a/Spine/SpineWrappers/ISkeletonClipping.cs b/Spine/Interfaces/ISkeletonClipping.cs similarity index 95% rename from Spine/SpineWrappers/ISkeletonClipping.cs rename to Spine/Interfaces/ISkeletonClipping.cs index d5dbe97..03ea138 100644 --- a/Spine/SpineWrappers/ISkeletonClipping.cs +++ b/Spine/Interfaces/ISkeletonClipping.cs @@ -1,11 +1,11 @@ -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces.Attachments; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers +namespace Spine.Interfaces { public interface ISkeletonClipping { diff --git a/Spine/SpineWrappers/ISkin.cs b/Spine/Interfaces/ISkin.cs similarity index 94% rename from Spine/SpineWrappers/ISkin.cs rename to Spine/Interfaces/ISkin.cs index 07b2c0f..70d2d5c 100644 --- a/Spine/SpineWrappers/ISkin.cs +++ b/Spine/Interfaces/ISkin.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers +namespace Spine.Interfaces { public interface ISkin { diff --git a/Spine/SpineWrappers/ISlot.cs b/Spine/Interfaces/ISlot.cs similarity index 94% rename from Spine/SpineWrappers/ISlot.cs rename to Spine/Interfaces/ISlot.cs index 27ac9ac..17ac84b 100644 --- a/Spine/SpineWrappers/ISlot.cs +++ b/Spine/Interfaces/ISlot.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces.Attachments; -namespace Spine.SpineWrappers +namespace Spine.Interfaces { public interface ISlot { @@ -58,5 +58,6 @@ namespace Spine.SpineWrappers /// 是否已禁用渲染该插槽 /// public bool Disabled { get; set; } + } } diff --git a/Spine/SpineWrappers/ISpineObjectData.cs b/Spine/Interfaces/ISpineObjectData.cs similarity index 95% rename from Spine/SpineWrappers/ISpineObjectData.cs rename to Spine/Interfaces/ISpineObjectData.cs index cc5d75d..288eb72 100644 --- a/Spine/SpineWrappers/ISpineObjectData.cs +++ b/Spine/Interfaces/ISpineObjectData.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers.Attachments; +using Spine.Interfaces.Attachments; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -7,7 +7,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers +namespace Spine.Interfaces { /// /// 对 SkeletonData 和 AnimationStateData 的访问封装 diff --git a/Spine/SpineWrappers/ITrackEntry.cs b/Spine/Interfaces/ITrackEntry.cs similarity index 98% rename from Spine/SpineWrappers/ITrackEntry.cs rename to Spine/Interfaces/ITrackEntry.cs index 69bee2e..39922bc 100644 --- a/Spine/SpineWrappers/ITrackEntry.cs +++ b/Spine/Interfaces/ITrackEntry.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Spine.SpineWrappers +namespace Spine.Interfaces { public interface ITrackEntry { diff --git a/Spine/Interfaces/SpineExtension.cs b/Spine/Interfaces/SpineExtension.cs new file mode 100644 index 0000000..751a391 --- /dev/null +++ b/Spine/Interfaces/SpineExtension.cs @@ -0,0 +1,122 @@ +using Spine.Interfaces.Attachments; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Spine.Interfaces +{ + public static class SpineExtension + { + /// + /// 获取当前状态包围盒 + /// + public static void GetBounds(this ISlot self, out float x, out float y, out float w, out float h) + { + float[] vertices = new float[8]; + int verticesLength = 0; + var attachment = self.Attachment; + switch (attachment) + { + case IRegionAttachment: + case IMeshAttachment: + verticesLength = attachment.ComputeWorldVertices(self, ref vertices); + break; + default: + break; + } + + if (verticesLength > 0) + { + float minX = int.MaxValue; + float minY = int.MaxValue; + float maxX = int.MinValue; + float maxY = int.MinValue; + for (int ii = 0; ii + 1 < verticesLength; ii += 2) + { + float vx = vertices[ii]; + float vy = vertices[ii + 1]; + minX = Math.Min(minX, vx); + minY = Math.Min(minY, vy); + maxX = Math.Max(maxX, vx); + maxY = Math.Max(maxY, vy); + } + x = minX; + y = minY; + w = maxX - minX; + h = maxY - minY; + } + else + { + x = self.Bone.WorldX; + y = self.Bone.WorldY; + w = 0; + h = 0; + } + } + + /// + /// 命中测试, 当插槽全透明或者处于禁用或者骨骼处于未激活则无法命中 + /// + public static bool HitTest(this ISlot self, float x, float y) + { + if (self.A <= 0 || !self.Bone.Active || self.Disabled) + return false; + + self.GetBounds(out var bx, out var by, out var bw, out var bh); + return x >= bx && x <= (bx + bw) && y >= by && y <= (by + bh); + } + + /// + /// 获取当前状态包围盒 + /// + public static void GetBounds(this ISkeleton self, out float x, out float y, out float w, out float h) + { + float minX = int.MaxValue; + float minY = int.MaxValue; + float maxX = int.MinValue; + float maxY = int.MinValue; + foreach (var slot in self.IterDrawOrder()) + { + if (slot.A <= 0 || !slot.Bone.Active || slot.Disabled) + continue; + + float[] vertices = new float[8]; + int verticesLength = 0; + var attachment = slot.Attachment; + switch (attachment) + { + case IRegionAttachment: + case IMeshAttachment: + verticesLength = attachment.ComputeWorldVertices(slot, ref vertices); + break; + default: + break; + } + + for (int ii = 0; ii + 1 < verticesLength; ii += 2) + { + float vx = vertices[ii]; + float vy = vertices[ii + 1]; + minX = Math.Min(minX, vx); + minY = Math.Min(minY, vy); + maxX = Math.Max(maxX, vx); + maxY = Math.Max(maxY, vy); + } + } + x = minX; + y = minY; + w = maxX - minX; + h = maxY - minY; + } + + /// + /// 逐插槽的命中测试, 不会计算处于禁用或者骨骼未激活的插槽, 比整体包围盒稍微精确一些 + /// + public static bool HitTest(this ISkeleton self, float x, float y) + { + return self.IterDrawOrder().Any(st => st.HitTest(x, y)); + } + } +} diff --git a/Spine/SpineWrappers/SpineObjectData.cs b/Spine/Interfaces/SpineObjectData.cs similarity index 97% rename from Spine/SpineWrappers/SpineObjectData.cs rename to Spine/Interfaces/SpineObjectData.cs index 7017d3c..18c4490 100644 --- a/Spine/SpineWrappers/SpineObjectData.cs +++ b/Spine/Interfaces/SpineObjectData.cs @@ -6,9 +6,10 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using NLog; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations; +using Spine.Interfaces.Attachments; -namespace Spine.SpineWrappers +namespace Spine.Interfaces { /// /// 应当继承该类实现多版本, 子类需要提供签名为 的构造函数 diff --git a/Spine/Spine.csproj b/Spine/Spine.csproj index d7ec78a..dc06ec4 100644 --- a/Spine/Spine.csproj +++ b/Spine/Spine.csproj @@ -32,10 +32,4 @@ - - - - - - diff --git a/Spine/SpineObject.cs b/Spine/SpineObject.cs index 1baff8e..564440e 100644 --- a/Spine/SpineObject.cs +++ b/Spine/SpineObject.cs @@ -1,6 +1,7 @@ using NLog; -using Spine.SpineWrappers; -using Spine.SpineWrappers.Attachments; +using Spine.Implementations; +using Spine.Interfaces; +using Spine.Interfaces.Attachments; using Spine.Utils; using System; using System.Collections.Frozen; diff --git a/SpineViewer/Extensions/SpineObjectExtension.cs b/SpineViewer/Extensions/SpineObjectExtension.cs index 9d8d703..ca24299 100644 --- a/SpineViewer/Extensions/SpineObjectExtension.cs +++ b/SpineViewer/Extensions/SpineObjectExtension.cs @@ -1,4 +1,5 @@ using Spine; +using Spine.Interfaces; using System; using System.Collections.Generic; using System.Linq; diff --git a/SpineViewer/Models/PreferenceModel.cs b/SpineViewer/Models/PreferenceModel.cs index c937a65..2b812d2 100644 --- a/SpineViewer/Models/PreferenceModel.cs +++ b/SpineViewer/Models/PreferenceModel.cs @@ -1,6 +1,5 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; -using Spine.SpineWrappers; using SpineViewer.Services; using System; using System.Collections.Generic; diff --git a/SpineViewer/Models/SpineObjectConfigModel.cs b/SpineViewer/Models/SpineObjectConfigModel.cs index 6f2c532..351ac3e 100644 --- a/SpineViewer/Models/SpineObjectConfigModel.cs +++ b/SpineViewer/Models/SpineObjectConfigModel.cs @@ -1,4 +1,4 @@ -using Spine.SpineWrappers; +using Spine.Interfaces; using System; using System.Collections.Generic; using System.IO; diff --git a/SpineViewer/Models/SpineObjectModel.cs b/SpineViewer/Models/SpineObjectModel.cs index 1612b96..cfaf4bd 100644 --- a/SpineViewer/Models/SpineObjectModel.cs +++ b/SpineViewer/Models/SpineObjectModel.cs @@ -15,7 +15,7 @@ using System.Windows.Media.Imaging; using CommunityToolkit.Mvvm.ComponentModel; using NLog; using Spine; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineViewer.Extensions; namespace SpineViewer.Models @@ -428,6 +428,14 @@ namespace SpineViewer.Models lock (_lock) return _spineObject.GetCurrentBounds(); } + /// + /// 命中检测, 可以比整体包围盒略精确一点 + /// + public bool HitTest(float x, float y) + { + lock (_lock) return _spineObject.Skeleton.HitTest(x, y); + } + public SpineObjectConfigModel ObjectConfig { get diff --git a/SpineViewer/ViewModels/MainWindow/ExplorerListViewModel.cs b/SpineViewer/ViewModels/MainWindow/ExplorerListViewModel.cs index 0f85b90..a4860de 100644 --- a/SpineViewer/ViewModels/MainWindow/ExplorerListViewModel.cs +++ b/SpineViewer/ViewModels/MainWindow/ExplorerListViewModel.cs @@ -20,6 +20,7 @@ using System.Windows; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shell; +using Spine.Interfaces; namespace SpineViewer.ViewModels.MainWindow { diff --git a/SpineViewer/ViewModels/MainWindow/PreferenceViewModel.cs b/SpineViewer/ViewModels/MainWindow/PreferenceViewModel.cs index 11c79c0..9818ff5 100644 --- a/SpineViewer/ViewModels/MainWindow/PreferenceViewModel.cs +++ b/SpineViewer/ViewModels/MainWindow/PreferenceViewModel.cs @@ -2,7 +2,7 @@ using CommunityToolkit.Mvvm.Input; using Microsoft.Win32; using NLog; -using Spine.SpineWrappers; +using Spine.Implementations; using SpineViewer.Models; using SpineViewer.Natives; using SpineViewer.Services; diff --git a/SpineViewer/ViewModels/MainWindow/SpineObjectTabViewModel.cs b/SpineViewer/ViewModels/MainWindow/SpineObjectTabViewModel.cs index 3462a2b..8f7bc69 100644 --- a/SpineViewer/ViewModels/MainWindow/SpineObjectTabViewModel.cs +++ b/SpineViewer/ViewModels/MainWindow/SpineObjectTabViewModel.cs @@ -1,7 +1,7 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using Spine; -using Spine.SpineWrappers; +using Spine.Interfaces; using SpineViewer.Models; using System.Collections; using System.Collections.Immutable; diff --git a/SpineViewerCLI/SpineViewerCLI.cs b/SpineViewerCLI/SpineViewerCLI.cs index 2c91c5e..6397632 100644 --- a/SpineViewerCLI/SpineViewerCLI.cs +++ b/SpineViewerCLI/SpineViewerCLI.cs @@ -4,6 +4,7 @@ using SFML.Graphics; using SFML.System; using Spine; using Spine.Exporters; +using Spine.Interfaces; namespace SpineViewerCLI { From 681b1be3607b694f381a275a680b62ceb21f351c Mon Sep 17 00:00:00 2001 From: ww-rm Date: Wed, 1 Oct 2025 18:45:03 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SpineViewer/ViewModels/MainWindow/SpineObjectListViewModel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SpineViewer/ViewModels/MainWindow/SpineObjectListViewModel.cs b/SpineViewer/ViewModels/MainWindow/SpineObjectListViewModel.cs index 8aec5dc..874f77f 100644 --- a/SpineViewer/ViewModels/MainWindow/SpineObjectListViewModel.cs +++ b/SpineViewer/ViewModels/MainWindow/SpineObjectListViewModel.cs @@ -503,7 +503,7 @@ namespace SpineViewer.ViewModels.MainWindow { if (ct.IsCancellationRequested) break; - var skelPath = paths[totalCount - 1 - i]; // 从后往前添加, 每次插入到列表的第一个 + var skelPath = paths[i]; reporter.ProgressText = $"[{i}/{totalCount}] {skelPath}"; if (AddSpineObject(skelPath)) @@ -620,7 +620,7 @@ namespace SpineViewer.ViewModels.MainWindow { if (ct.IsCancellationRequested) break; - var cfg = models[totalCount - 1 - i]; // 从后往前添加, 每次插入到列表的第一个 + var cfg = models[i]; reporter.ProgressText = $"[{i}/{totalCount}] {cfg}"; if (AddSpineObject(cfg)) From 44548618e8b0af5418ca722085b36ce56a241cb9 Mon Sep 17 00:00:00 2001 From: ww-rm Date: Wed, 1 Oct 2025 19:58:39 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E7=B2=BE=E7=AE=80=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Attachments/ISkinnedMeshAttachment.cs | 40 +----------- Spine/SpineObject.cs | 63 ------------------- 2 files changed, 1 insertion(+), 102 deletions(-) diff --git a/Spine/Interfaces/Attachments/ISkinnedMeshAttachment.cs b/Spine/Interfaces/Attachments/ISkinnedMeshAttachment.cs index 169e535..687da97 100644 --- a/Spine/Interfaces/Attachments/ISkinnedMeshAttachment.cs +++ b/Spine/Interfaces/Attachments/ISkinnedMeshAttachment.cs @@ -7,46 +7,8 @@ using System.Threading.Tasks; namespace Spine.Interfaces.Attachments { - public interface ISkinnedMeshAttachment : IAttachment + public interface ISkinnedMeshAttachment : IMeshAttachment { - /// - /// R - /// - public float R { get; set; } - /// - /// G - /// - public float G { get; set; } - - /// - /// B - /// - public float B { get; set; } - - /// - /// A - /// - public float A { get; set; } - - /// - /// 用于渲染的纹理对象 - /// - public SFML.Graphics.Texture RendererObject { get; } - - /// - /// 顶点纹理坐标, 每个坐标有 u 和 v 两个数, 有效长度和 返回值一致 - /// - public float[] UVs { get; } - - /// - /// 三角形索引顶点数组, 每 3 个为一组, 指向顶点的下标 (不是顶点坐标数组下标) - /// - public int[] Triangles { get; } - - /// - /// 边缘顶点数组长度 - /// - public int HullLength { get; } } } diff --git a/Spine/SpineObject.cs b/Spine/SpineObject.cs index 564440e..0b1ce25 100644 --- a/Spine/SpineObject.cs +++ b/Spine/SpineObject.cs @@ -558,18 +558,6 @@ namespace Spine tintA *= meshAttachment.A; texture = meshAttachment.RendererObject; break; - case ISkinnedMeshAttachment skinnedMeshAttachment: - worldVerticesLength = skinnedMeshAttachment.ComputeWorldVertices(slot, ref _worldVertices); - worldVertices = _worldVertices; - triangles = skinnedMeshAttachment.Triangles; - trianglesLength = triangles.Length; - uvs = skinnedMeshAttachment.UVs; - tintR *= skinnedMeshAttachment.R; - tintG *= skinnedMeshAttachment.G; - tintB *= skinnedMeshAttachment.B; - tintA *= skinnedMeshAttachment.A; - texture = skinnedMeshAttachment.RendererObject; - break; case IClippingAttachment clippingAttachment: _clipping.ClipStart(slot, clippingAttachment); continue; @@ -697,34 +685,6 @@ namespace Spine vt.Position.Y = _worldVertices[idx2 + 1]; _lineVertices.Append(vt); _lineVertices.Append(vt); - vt.Position.X = _worldVertices[idx0]; - vt.Position.Y = _worldVertices[idx0 + 1]; - _lineVertices.Append(vt); - } - } - else if (slot.Attachment is ISkinnedMeshAttachment skinnedMeshAttachment) - { - skinnedMeshAttachment.ComputeWorldVertices(slot, ref _worldVertices); - - var triangles = skinnedMeshAttachment.Triangles; - for (int i = 0; i < triangles.Length - 2; i += 3) - { - var idx0 = triangles[i] << 1; - var idx1 = triangles[i + 1] << 1; - var idx2 = triangles[i + 2] << 1; - - vt.Position.X = _worldVertices[idx0]; - vt.Position.Y = _worldVertices[idx0 + 1]; - _lineVertices.Append(vt); - - vt.Position.X = _worldVertices[idx1]; - vt.Position.Y = _worldVertices[idx1 + 1]; - _lineVertices.Append(vt); _lineVertices.Append(vt); - - vt.Position.X = _worldVertices[idx2]; - vt.Position.Y = _worldVertices[idx2 + 1]; - _lineVertices.Append(vt); _lineVertices.Append(vt); - vt.Position.X = _worldVertices[idx0]; vt.Position.Y = _worldVertices[idx0 + 1]; _lineVertices.Append(vt); @@ -757,29 +717,6 @@ namespace Spine _lineVertices.Append(vt); } - vt.Position.X = _worldVertices[0]; - vt.Position.Y = _worldVertices[1]; - _lineVertices.Append(vt); - } - else if (slot.Attachment is ISkinnedMeshAttachment skinnedMeshAttachment) - { - skinnedMeshAttachment.ComputeWorldVertices(slot, ref _worldVertices); - - var hullLength = skinnedMeshAttachment.HullLength; - if (hullLength < 4) continue; - - vt.Position.X = _worldVertices[0]; - vt.Position.Y = _worldVertices[1]; - _lineVertices.Append(vt); - - for (int i = 2; i < hullLength - 1; i += 2) - { - vt.Position.X = _worldVertices[i]; - vt.Position.Y = _worldVertices[i + 1]; - _lineVertices.Append(vt); - _lineVertices.Append(vt); - } - vt.Position.X = _worldVertices[0]; vt.Position.Y = _worldVertices[1]; _lineVertices.Append(vt); From 42bd5c2830ed6647a37c23725094c1432d00d97f Mon Sep 17 00:00:00 2001 From: ww-rm Date: Wed, 1 Oct 2025 23:43:03 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=B2=BE=E7=A1=AE?= =?UTF-8?q?=E5=91=BD=E4=B8=AD=E6=A3=80=E6=B5=8B=E5=92=8C=E6=8F=92=E6=A7=BD?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Spine/Interfaces/SpineExtension.cs | 140 ++++++++++++++++-- SpineViewer/Models/PreferenceModel.cs | 6 + SpineViewer/Models/SpineObjectModel.cs | 14 +- SpineViewer/Resources/Strings/en.xaml | 4 + SpineViewer/Resources/Strings/ja.xaml | 4 + SpineViewer/Resources/Strings/zh.xaml | 4 + .../MainWindow/PreferenceViewModel.cs | 16 ++ .../MainWindow/SFMLRendererViewModel.cs | 109 +++++++++++--- SpineViewer/Views/PreferenceDialog.xaml | 33 +++-- 9 files changed, 277 insertions(+), 53 deletions(-) diff --git a/Spine/Interfaces/SpineExtension.cs b/Spine/Interfaces/SpineExtension.cs index 751a391..b6f3c0d 100644 --- a/Spine/Interfaces/SpineExtension.cs +++ b/Spine/Interfaces/SpineExtension.cs @@ -1,4 +1,5 @@ -using Spine.Interfaces.Attachments; +using SkiaSharp; +using Spine.Interfaces.Attachments; using System; using System.Collections.Generic; using System.Linq; @@ -56,18 +57,6 @@ namespace Spine.Interfaces } } - /// - /// 命中测试, 当插槽全透明或者处于禁用或者骨骼处于未激活则无法命中 - /// - public static bool HitTest(this ISlot self, float x, float y) - { - if (self.A <= 0 || !self.Bone.Active || self.Disabled) - return false; - - self.GetBounds(out var bx, out var by, out var bw, out var bh); - return x >= bx && x <= (bx + bw) && y >= by && y <= (by + bh); - } - /// /// 获取当前状态包围盒 /// @@ -112,11 +101,130 @@ namespace Spine.Interfaces } /// - /// 逐插槽的命中测试, 不会计算处于禁用或者骨骼未激活的插槽, 比整体包围盒稍微精确一些 + /// 命中测试, 当插槽全透明或者处于禁用或者骨骼处于未激活则无法命中 /// - public static bool HitTest(this ISkeleton self, float x, float y) + /// 是否精确命中检测, 否则仅使用包围盒进行命中检测 + /// 调用方管理的缓存表 + public static bool HitTest(this ISlot self, float x, float y, bool precise = false, Dictionary cache = null) { - return self.IterDrawOrder().Any(st => st.HitTest(x, y)); + if (self.A <= 0 || !self.Bone.Active || self.Disabled) + return false; + + if (!precise) + { + self.GetBounds(out var bx, out var by, out var bw, out var bh); + return x >= bx && x <= (bx + bw) && y >= by && y <= (by + bh); + } + else + { + float[] vertices = new float[8]; + int[] triangles; + float[] uvs; + SFML.Graphics.Texture tex; + + switch (self.Attachment) + { + case IRegionAttachment regionAttachment: + _ = regionAttachment.ComputeWorldVertices(self, ref vertices); + triangles = regionAttachment.Triangles; + uvs = regionAttachment.UVs; + tex = regionAttachment.RendererObject; + break; + case IMeshAttachment meshAttachment: + _ = meshAttachment.ComputeWorldVertices(self, ref vertices); + triangles = meshAttachment.Triangles; + uvs = meshAttachment.UVs; + tex = meshAttachment.RendererObject; + break; + default: + return false; + } + + SFML.Graphics.Image img = null; + if (cache is not null) + { + if (!cache.TryGetValue(tex, out img)) + { + img = cache[tex] = tex.CopyToImage(); + } + } + else + { + img = tex.CopyToImage(); + } + + bool hit = false; + var trianglesLength = triangles.Length; + var texSize = img.Size; + for (int i = 0; i + 2 < trianglesLength; i += 3) + { + var idx0 = triangles[i] << 1; + var idx1 = triangles[i + 1] << 1; + var idx2 = triangles[i + 2] << 1; + + float x0 = vertices[idx0] - x, y0 = vertices[idx0 + 1] - y; + float x1 = vertices[idx1] - x, y1 = vertices[idx1 + 1] - y; + float x2 = vertices[idx2] - x, y2 = vertices[idx2 + 1] - y; + + float c0 = Cross(x0, y0, x1, y1); + float c1 = Cross(x1, y1, x2, y2); + float c2 = Cross(x2, y2, x0, y0); + + // 判断是否全部同号 (或为 0, 点在边上) + if ((c0 >= 0 && c1 >= 0 && c2 >= 0) || (c0 <= 0 && c1 <= 0 && c2 <= 0)) + { + float u0 = uvs[idx0], v0 = uvs[idx0 + 1]; + float u1 = uvs[idx1], v1 = uvs[idx1 + 1]; + float u2 = uvs[idx2], v2 = uvs[idx2 + 1]; + float inv = 1 / (c0 + c1 + c2); + float w0 = c1 * inv; + float w1 = c2 * inv; + float w2 = c0 * inv; + float u = u0 * w0 + u1 * w1 + u2 * w2; + float v = v0 * w0 + v1 * w1 + v2 * w2; + + var pixel = img.GetPixel((uint)(u * texSize.X), (uint)(v * texSize.Y)); + hit = pixel.A > 0; + break; + } + } + + // 无缓存需要立即释放资源 + if (cache is null) + { + img.Dispose(); + } + + return hit; + } } + + /// + /// 逐插槽的命中测试, 命中后会提前返回结果中止计算 + /// + public static bool HitTest(this ISkeleton self, float x, float y, bool precise = false) + { + var cache = new Dictionary(); + bool hit = self.IterDrawOrder().Any(st => st.HitTest(x, y, precise, cache)); + foreach (var img in cache.Values) img.Dispose(); + return hit; + } + + /// + /// 逐插槽的命中测试, 会完整计算所有插槽的命中情况并按顶层至底层的顺序返回命中的插槽 + /// /// 是否精确命中检测, 否则仅使用每个插槽的包围盒进行命中检测 + /// + public static ISlot[] HitTestFull(this ISkeleton self, float x, float y, bool precise = false) + { + var cache = new Dictionary(); + var hitSlots = self.IterDrawOrder().Where(st => st.HitTest(x, y, precise, cache)).Reverse().ToArray(); + foreach (var img in cache.Values) img.Dispose(); + return hitSlots; + } + + /// + /// 向量叉积 + /// + private static float Cross(float x0, float y0, float x1, float y1) => x0 * y1 - y0 * x1; } } diff --git a/SpineViewer/Models/PreferenceModel.cs b/SpineViewer/Models/PreferenceModel.cs index 2b812d2..61beced 100644 --- a/SpineViewer/Models/PreferenceModel.cs +++ b/SpineViewer/Models/PreferenceModel.cs @@ -88,6 +88,12 @@ namespace SpineViewer.Models [ObservableProperty] private bool _renderSelectedOnly; + [ObservableProperty] + private bool _usePreciseHitTest; + + [ObservableProperty] + private bool _logHitSlots; + [ObservableProperty] private bool _wallpaperView; diff --git a/SpineViewer/Models/SpineObjectModel.cs b/SpineViewer/Models/SpineObjectModel.cs index cfaf4bd..ddb920f 100644 --- a/SpineViewer/Models/SpineObjectModel.cs +++ b/SpineViewer/Models/SpineObjectModel.cs @@ -429,11 +429,19 @@ namespace SpineViewer.Models } /// - /// 命中检测, 可以比整体包围盒略精确一点 + /// 命中检测, 可选是否使用精确检测, 会有性能损失 /// - public bool HitTest(float x, float y) + public bool HitTest(float x, float y, bool precise = false) { - lock (_lock) return _spineObject.Skeleton.HitTest(x, y); + lock (_lock) return _spineObject.Skeleton.HitTest(x, y, precise); + } + + /// + /// 完整的命中检测, 会检测所有插槽是否命中并返回命中的插槽名称 + /// + public string[] HitTestFull(float x, float y, bool precise = false) + { + lock (_lock) return _spineObject.Skeleton.HitTestFull(x, y, precise).Select(v => v.Name).ToArray(); } public SpineObjectConfigModel ObjectConfig diff --git a/SpineViewer/Resources/Strings/en.xaml b/SpineViewer/Resources/Strings/en.xaml index a63f3a4..ffa0d04 100644 --- a/SpineViewer/Resources/Strings/en.xaml +++ b/SpineViewer/Resources/Strings/en.xaml @@ -120,6 +120,10 @@ Playback Speed Wallpaper View Render Selected Only + Use Precise Hit Testing + When enabled, click detection will be performed based on pixel transparency of the model. + Log Hit Slot Names + When enabled, the log box will output the model and slot information hit by each click operation (will not output when using Ctrl for multi-selection). Show Axis Background Color Background Image Path diff --git a/SpineViewer/Resources/Strings/ja.xaml b/SpineViewer/Resources/Strings/ja.xaml index 168cc59..4759e47 100644 --- a/SpineViewer/Resources/Strings/ja.xaml +++ b/SpineViewer/Resources/Strings/ja.xaml @@ -120,6 +120,10 @@ 再生速度 壁紙表示 選択のみレンダリング + 精密ヒットテストを使用 + 有効にすると、モデルのピクセル透過度に基づいてクリック判定を行います。 + ヒットしたスロット名を出力 + 有効にすると、ログボックスに各クリック操作でヒットしたモデルとスロットの情報を出力します(Ctrlを押しながら複数選択する場合は出力されません)。 座標軸を表示 背景色 背景画像のパス diff --git a/SpineViewer/Resources/Strings/zh.xaml b/SpineViewer/Resources/Strings/zh.xaml index 5884c6e..13421bd 100644 --- a/SpineViewer/Resources/Strings/zh.xaml +++ b/SpineViewer/Resources/Strings/zh.xaml @@ -120,6 +120,10 @@ 播放速度 桌面投影 仅渲染选中 + 使用精确命中检测 + 启用后将会按像素透明度来检测点击操作是否命中了模型 + 输出命中的插槽名称 + 启用后将会在日志框内输出每一次点击操作命中的模型和插槽情况(按下 Ctrl 进行多选时不会输出) 显示坐标轴 背景颜色 背景图片路径 diff --git a/SpineViewer/ViewModels/MainWindow/PreferenceViewModel.cs b/SpineViewer/ViewModels/MainWindow/PreferenceViewModel.cs index 9818ff5..02cfa54 100644 --- a/SpineViewer/ViewModels/MainWindow/PreferenceViewModel.cs +++ b/SpineViewer/ViewModels/MainWindow/PreferenceViewModel.cs @@ -109,6 +109,8 @@ namespace SpineViewer.ViewModels.MainWindow AppLanguage = AppLanguage, RenderSelectedOnly = RenderSelectedOnly, + UsePreciseHitTest = UsePreciseHitTest, + LogHitSlots = LogHitSlots, WallpaperView = WallpaperView, CloseToTray = CloseToTray, AutoRun = AutoRun, @@ -138,6 +140,8 @@ namespace SpineViewer.ViewModels.MainWindow AppLanguage = value.AppLanguage; RenderSelectedOnly = value.RenderSelectedOnly; + UsePreciseHitTest = value.UsePreciseHitTest; + LogHitSlots = value.LogHitSlots; WallpaperView = value.WallpaperView; CloseToTray = value.CloseToTray; AutoRun = value.AutoRun; @@ -260,6 +264,18 @@ namespace SpineViewer.ViewModels.MainWindow set => SetProperty(_vmMain.SFMLRendererViewModel.RenderSelectedOnly, value, v => _vmMain.SFMLRendererViewModel.RenderSelectedOnly = v); } + public bool UsePreciseHitTest + { + get => _vmMain.SFMLRendererViewModel.UsePreciseHitTest; + set => SetProperty(_vmMain.SFMLRendererViewModel.UsePreciseHitTest, value, v => _vmMain.SFMLRendererViewModel.UsePreciseHitTest = v); + } + + public bool LogHitSlots + { + get => _vmMain.SFMLRendererViewModel.LogHitSlots; + set => SetProperty(_vmMain.SFMLRendererViewModel.LogHitSlots, value, v => _vmMain.SFMLRendererViewModel.LogHitSlots = v); + } + public bool WallpaperView { get => _vmMain.SFMLRendererViewModel.WallpaperView; diff --git a/SpineViewer/ViewModels/MainWindow/SFMLRendererViewModel.cs b/SpineViewer/ViewModels/MainWindow/SFMLRendererViewModel.cs index dbf51f5..b574eb5 100644 --- a/SpineViewer/ViewModels/MainWindow/SFMLRendererViewModel.cs +++ b/SpineViewer/ViewModels/MainWindow/SFMLRendererViewModel.cs @@ -240,6 +240,39 @@ namespace SpineViewer.ViewModels.MainWindow } private Stretch _backgroundImageMode = Stretch.Uniform; + /// + /// 仅渲染选中对象 + /// + public bool RenderSelectedOnly + { + get => _renderSelectedOnly; + set => SetProperty(ref _renderSelectedOnly, value); + } + private bool _renderSelectedOnly; + + /// + /// 启用精确命中测试 + /// + public bool UsePreciseHitTest + { + get => _usePreciseHitTest; + set => SetProperty(ref _usePreciseHitTest, value); + } + private bool _usePreciseHitTest; + + /// + /// 启用完整的命中测试并在日志中输出命中测试的插槽结果 + /// + public bool LogHitSlots + { + get => _logHitSlots; + set => SetProperty(ref _logHitSlots, value); + } + private bool _logHitSlots; + + /// + /// 启用桌面投影 + /// public bool WallpaperView { get => _wallpaperView; @@ -247,13 +280,6 @@ namespace SpineViewer.ViewModels.MainWindow } private bool _wallpaperView; - public bool RenderSelectedOnly - { - get => _renderSelectedOnly; - set => SetProperty(ref _renderSelectedOnly, value); - } - private bool _renderSelectedOnly = false; - public bool IsUpdating { get => _isUpdating; @@ -333,17 +359,31 @@ namespace SpineViewer.ViewModels.MainWindow } else if (e.Button == SFML.Window.Mouse.Button.Left && !SFML.Window.Mouse.IsButtonPressed(SFML.Window.Mouse.Button.Right)) { - var _src = _renderer.MapPixelToCoords(new(e.X, e.Y)); - var src = new Point(_src.X, _src.Y); - _draggingSrc = _src; + var src = _renderer.MapPixelToCoords(new(e.X, e.Y)); + _draggingSrc = src; lock (_models.Lock) { // 仅渲染选中模式禁止在画面里选择对象 if (_renderSelectedOnly) { - // 只在被选中的对象里判断是否有效命中 - bool hit = _models.Any(m => m.IsSelected && m.GetCurrentBounds().Contains(src)); + bool hit = false; + if (!_logHitSlots) + { + // 只在被选中的对象里判断是否有效命中 + hit = _models.Any(m => m.IsSelected && m.HitTest(src.X, src.Y, _usePreciseHitTest)); + } + else + { + foreach (var sp in _models.Where(m => m.IsSelected)) + { + var slotNames = sp.HitTestFull(src.X, src.Y, _usePreciseHitTest); + if (slotNames.Length <= 0) continue; + + hit = true; + _logger.Debug("Model Hit ({0}): [{1}]", sp.Name, string.Join(", ", slotNames)); + } + } // 如果没点到被选中的模型, 则不允许拖动 if (!hit) _draggingSrc = null; @@ -354,20 +394,41 @@ namespace SpineViewer.ViewModels.MainWindow { // 没按 Ctrl 的情况下, 如果命中了已选中对象, 则就算普通命中 bool hit = false; - foreach (var sp in _models) + + if (!_logHitSlots) { - if (!sp.IsShown) continue; - if (!sp.GetCurrentBounds().Contains(src)) continue; - - hit = true; - - // 如果点到了没被选中的东西, 则清空原先选中的, 改为只选中这一次点的 - if (!sp.IsSelected) + foreach (var sp in _models.Where(m => m.IsShown)) { - RequestSelectionChanging?.Invoke(this, new(NotifyCollectionChangedAction.Reset)); - RequestSelectionChanging?.Invoke(this, new(NotifyCollectionChangedAction.Add, sp)); + if (!sp.HitTest(src.X, src.Y, _usePreciseHitTest)) continue; + + hit = true; + + // 如果点到了没被选中的东西, 则清空原先选中的, 改为只选中这一次点的 + if (!sp.IsSelected) + { + RequestSelectionChanging?.Invoke(this, new(NotifyCollectionChangedAction.Reset)); + RequestSelectionChanging?.Invoke(this, new(NotifyCollectionChangedAction.Add, sp)); + } + break; + } + } + else + { + foreach (var sp in _models.Where(m => m.IsShown)) + { + var slotNames = sp.HitTestFull(src.X, src.Y, _usePreciseHitTest); + if (slotNames.Length <= 0) continue; + + // 如果点到了没被选中的东西, 则清空原先选中的, 改为只选中这一次点的 + // 仅判断顶层对象 (首次命中) + if (!hit && !sp.IsSelected) + { + RequestSelectionChanging?.Invoke(this, new(NotifyCollectionChangedAction.Reset)); + RequestSelectionChanging?.Invoke(this, new(NotifyCollectionChangedAction.Add, sp)); + } + hit = true; + _logger.Debug("Model Hit ({0}): [{1}]", sp.Name, string.Join(", ", slotNames)); } - break; } // 如果点了空白的地方, 就清空选中列表 @@ -376,7 +437,7 @@ namespace SpineViewer.ViewModels.MainWindow else { // 按下 Ctrl 的情况就执行多选, 并且点空白处也不会清空选中, 如果点击了本来就是选中的则取消选中 - if (_models.FirstOrDefault(m => m.IsShown && m.GetCurrentBounds().Contains(src), null) is SpineObjectModel sp) + if (_models.FirstOrDefault(m => m.IsShown && m.HitTest(src.X, src.Y, _usePreciseHitTest), null) is SpineObjectModel sp) { if (sp.IsSelected) RequestSelectionChanging?.Invoke(this, new(NotifyCollectionChangedAction.Remove, sp)); diff --git a/SpineViewer/Views/PreferenceDialog.xaml b/SpineViewer/Views/PreferenceDialog.xaml index 8c4c8e2..8610285 100644 --- a/SpineViewer/Views/PreferenceDialog.xaml +++ b/SpineViewer/Views/PreferenceDialog.xaml @@ -215,8 +215,25 @@