Commit 648170f 1 parent a815fc4 commit 648170f Copy full SHA for 648170f
File tree 3 files changed +17
-0
lines changed
3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -2424,6 +2424,16 @@ spine_attachment spine_attachment_copy(spine_attachment attachment) {
2424
2424
return (spine_attachment) _attachment->copy ();
2425
2425
}
2426
2426
2427
+ spine_bounding_box_attachment spine_attachment_cast_to_bounding_box_attachment (spine_attachment attachment) {
2428
+ if (attachment == nullptr ) return nullptr ;
2429
+ Attachment *_attachment = (Attachment *)attachment;
2430
+ if (_attachment->getRTTI ().isExactly (BoundingBoxAttachment::rtti)) {
2431
+ BoundingBoxAttachment *boundingBox = static_cast <BoundingBoxAttachment *>(_attachment);
2432
+ return (spine_bounding_box_attachment)boundingBox;
2433
+ }
2434
+ return nullptr ;
2435
+ }
2436
+
2427
2437
void spine_attachment_dispose (spine_attachment attachment) {
2428
2438
if (attachment == nullptr ) return ;
2429
2439
Attachment *_attachment = (Attachment *) attachment;
Original file line number Diff line number Diff line change @@ -630,6 +630,8 @@ SPINE_CPP_LITE_EXPORT const utf8 *spine_attachment_get_name(spine_attachment att
630
630
SPINE_CPP_LITE_EXPORT spine_attachment_type spine_attachment_get_type (spine_attachment attachment );
631
631
// @ignore
632
632
SPINE_CPP_LITE_EXPORT spine_attachment spine_attachment_copy (spine_attachment attachment );
633
+ // @optional
634
+ SPINE_CPP_LITE_EXPORT spine_bounding_box_attachment spine_attachment_cast_to_bounding_box_attachment (spine_attachment attachment );
633
635
SPINE_CPP_LITE_EXPORT void spine_attachment_dispose (spine_attachment attachment );
634
636
635
637
SPINE_CPP_LITE_EXPORT spine_vector spine_point_attachment_compute_world_position (spine_point_attachment attachment , spine_bone bone );
Original file line number Diff line number Diff line change @@ -2553,6 +2553,11 @@ public final class Attachment: NSObject {
2553
2553
return spine_attachment_get_type ( wrappee)
2554
2554
}
2555
2555
2556
+ @discardableResult
2557
+ public func castToBoundingBoxAttachment( ) -> BoundingBoxAttachment ? {
2558
+ return spine_attachment_cast_to_bounding_box_attachment ( wrappee) . flatMap { . init( $0) }
2559
+ }
2560
+
2556
2561
public func dispose( ) {
2557
2562
if disposed { return }
2558
2563
disposed = true
You can’t perform that action at this time.
0 commit comments