mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-18 04:51:47 +08:00
[unity] AttachmentTools handle Points and Clipping
This commit is contained in:
parent
0abefacf23
commit
7361358121
@ -798,6 +798,14 @@ namespace Spine.Unity.Modules.AttachmentTools {
|
||||
if (pathAttachment != null)
|
||||
return pathAttachment.GetClone();
|
||||
|
||||
var pointAttachment = o as PointAttachment;
|
||||
if (pointAttachment != null)
|
||||
return pointAttachment.GetClone();
|
||||
|
||||
var clippingAttachment = o as ClippingAttachment;
|
||||
if (clippingAttachment != null)
|
||||
return clippingAttachment.GetClone();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -829,6 +837,23 @@ namespace Spine.Unity.Modules.AttachmentTools {
|
||||
};
|
||||
}
|
||||
|
||||
public static ClippingAttachment GetClone (this ClippingAttachment o) {
|
||||
var ca = new ClippingAttachment(o.Name) {
|
||||
endSlot = o.endSlot
|
||||
};
|
||||
CloneVertexAttachment(o, ca);
|
||||
return ca;
|
||||
}
|
||||
|
||||
public static PointAttachment GetClone (this PointAttachment o) {
|
||||
var pa = new PointAttachment(o.Name) {
|
||||
rotation = o.rotation,
|
||||
x = o.x,
|
||||
y = o.y
|
||||
};
|
||||
return pa;
|
||||
}
|
||||
|
||||
public static BoundingBoxAttachment GetClone (this BoundingBoxAttachment o) {
|
||||
var ba = new BoundingBoxAttachment(o.Name);
|
||||
CloneVertexAttachment(o, ba);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user