|
@@ -112,27 +112,10 @@ namespace Spine.Unity {
|
|
}
|
|
}
|
|
|
|
|
|
if (this.gameObject.activeInHierarchy) {
|
|
if (this.gameObject.activeInHierarchy) {
|
|
- foreach (var skin in skeleton.Data.Skins) {
|
|
|
|
- var attachmentNames = new List<string>();
|
|
|
|
- skin.FindNamesForSlot(slotIndex, attachmentNames);
|
|
|
|
-
|
|
|
|
- foreach (var skinKey in attachmentNames) {
|
|
|
|
- var attachment = skin.GetAttachment(slotIndex, skinKey);
|
|
|
|
- var boundingBoxAttachment = attachment as BoundingBoxAttachment;
|
|
|
|
-
|
|
|
|
- if (BoundingBoxFollower.DebugMessages && attachment != null && boundingBoxAttachment == null)
|
|
|
|
- Debug.Log("BoundingBoxFollower tried to follow a slot that contains non-boundingbox attachments: " + slotName);
|
|
|
|
-
|
|
|
|
- if (boundingBoxAttachment != null) {
|
|
|
|
- var bbCollider = SkeletonUtility.AddBoundingBoxAsComponent(boundingBoxAttachment, slot, gameObject, isTrigger);
|
|
|
|
- bbCollider.enabled = false;
|
|
|
|
- bbCollider.hideFlags = HideFlags.NotEditable;
|
|
|
|
- bbCollider.isTrigger = IsTrigger;
|
|
|
|
- colliderTable.Add(boundingBoxAttachment, bbCollider);
|
|
|
|
- nameTable.Add(boundingBoxAttachment, skinKey);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ foreach (var skin in skeleton.Data.Skins)
|
|
|
|
+ AddSkin(skin, skeleton, slotIndex);
|
|
|
|
+
|
|
|
|
+ AddSkin(skeleton.skin, skeleton, slotIndex);
|
|
}
|
|
}
|
|
|
|
|
|
if (BoundingBoxFollower.DebugMessages) {
|
|
if (BoundingBoxFollower.DebugMessages) {
|
|
@@ -146,6 +129,28 @@ namespace Spine.Unity {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ void AddSkin (Skin skin, Skeleton skeleton, int slotIndex) {
|
|
|
|
+ var attachmentNames = new List<string>();
|
|
|
|
+ skin.FindNamesForSlot(slotIndex, attachmentNames);
|
|
|
|
+
|
|
|
|
+ foreach (var skinKey in attachmentNames) {
|
|
|
|
+ var attachment = skin.GetAttachment(slotIndex, skinKey);
|
|
|
|
+ var boundingBoxAttachment = attachment as BoundingBoxAttachment;
|
|
|
|
+
|
|
|
|
+ if (BoundingBoxFollower.DebugMessages && attachment != null && boundingBoxAttachment == null)
|
|
|
|
+ Debug.Log("BoundingBoxFollower tried to follow a slot that contains non-boundingbox attachments: " + slotName);
|
|
|
|
+
|
|
|
|
+ if (boundingBoxAttachment != null) {
|
|
|
|
+ var bbCollider = SkeletonUtility.AddBoundingBoxAsComponent(boundingBoxAttachment, slot, gameObject, isTrigger);
|
|
|
|
+ bbCollider.enabled = false;
|
|
|
|
+ bbCollider.hideFlags = HideFlags.NotEditable;
|
|
|
|
+ bbCollider.isTrigger = IsTrigger;
|
|
|
|
+ colliderTable.Add(boundingBoxAttachment, bbCollider);
|
|
|
|
+ nameTable.Add(boundingBoxAttachment, skinKey);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
void OnDisable () {
|
|
void OnDisable () {
|
|
if (clearStateOnDisable)
|
|
if (clearStateOnDisable)
|
|
ClearState();
|
|
ClearState();
|