mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[unity] Fixed BoundingBoxFollower and BoundingBoxFollowerGraphic ignoring deactivated skin bone. Closes #2836.
This commit is contained in:
parent
ff572ec8a4
commit
480a4b18b7
@ -57,7 +57,7 @@ namespace Spine.Unity {
|
||||
BoundingBoxAttachment currentAttachment;
|
||||
string currentAttachmentName;
|
||||
PolygonCollider2D currentCollider;
|
||||
|
||||
bool skinBoneEnabled = true;
|
||||
public readonly Dictionary<BoundingBoxAttachment, PolygonCollider2D> colliderTable = new Dictionary<BoundingBoxAttachment, PolygonCollider2D>();
|
||||
public readonly Dictionary<BoundingBoxAttachment, string> nameTable = new Dictionary<BoundingBoxAttachment, string>();
|
||||
|
||||
@ -132,6 +132,7 @@ namespace Spine.Unity {
|
||||
AddCollidersForSkin(skeleton.Skin, slotIndex, colliders, ref requiredCollidersCount);
|
||||
}
|
||||
DisposeExcessCollidersAfter(requiredCollidersCount);
|
||||
skinBoneEnabled = slot.Bone.Active;
|
||||
|
||||
if (BoundingBoxFollower.DebugMessages) {
|
||||
bool valid = colliderTable.Count != 0;
|
||||
@ -210,8 +211,10 @@ namespace Spine.Unity {
|
||||
}
|
||||
|
||||
void LateUpdate () {
|
||||
if (slot != null && slot.Attachment != currentAttachment)
|
||||
if (slot != null && (slot.Attachment != currentAttachment || skinBoneEnabled != slot.Bone.Active)) {
|
||||
skinBoneEnabled = slot.Bone.Active;
|
||||
MatchAttachment(slot.Attachment);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the current collider to match attachment.</summary>
|
||||
@ -225,7 +228,7 @@ namespace Spine.Unity {
|
||||
if (currentCollider != null)
|
||||
currentCollider.enabled = false;
|
||||
|
||||
if (bbAttachment == null) {
|
||||
if (bbAttachment == null || !skinBoneEnabled) {
|
||||
currentCollider = null;
|
||||
currentAttachment = null;
|
||||
currentAttachmentName = null;
|
||||
|
||||
@ -57,7 +57,7 @@ namespace Spine.Unity {
|
||||
BoundingBoxAttachment currentAttachment;
|
||||
string currentAttachmentName;
|
||||
PolygonCollider2D currentCollider;
|
||||
|
||||
bool skinBoneEnabled = true;
|
||||
public readonly Dictionary<BoundingBoxAttachment, PolygonCollider2D> colliderTable = new Dictionary<BoundingBoxAttachment, PolygonCollider2D>();
|
||||
public readonly Dictionary<BoundingBoxAttachment, string> nameTable = new Dictionary<BoundingBoxAttachment, string>();
|
||||
|
||||
@ -133,6 +133,7 @@ namespace Spine.Unity {
|
||||
AddCollidersForSkin(skeleton.Skin, slotIndex, colliders, scale, ref requiredCollidersCount);
|
||||
}
|
||||
DisposeExcessCollidersAfter(requiredCollidersCount);
|
||||
skinBoneEnabled = slot.Bone.Active;
|
||||
|
||||
if (BoundingBoxFollowerGraphic.DebugMessages) {
|
||||
bool valid = colliderTable.Count != 0;
|
||||
@ -211,8 +212,10 @@ namespace Spine.Unity {
|
||||
}
|
||||
|
||||
void LateUpdate () {
|
||||
if (slot != null && slot.Attachment != currentAttachment)
|
||||
if (slot != null && (slot.Attachment != currentAttachment || skinBoneEnabled != slot.Bone.Active)) {
|
||||
skinBoneEnabled = slot.Bone.Active;
|
||||
MatchAttachment(slot.Attachment);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the current collider to match attachment.</summary>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "com.esotericsoftware.spine.spine-unity",
|
||||
"displayName": "spine-unity Runtime",
|
||||
"description": "This plugin provides the spine-unity runtime core.",
|
||||
"version": "4.2.102",
|
||||
"version": "4.2.103",
|
||||
"unity": "2018.3",
|
||||
"author": {
|
||||
"name": "Esoteric Software",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user