[unity] BoundingBoxFollower also uses active skin.

This commit is contained in:
John 2017-07-04 08:57:38 +08:00 committed by GitHub
parent dac38e5843
commit 263c6278e2

View File

@ -112,7 +112,24 @@ namespace Spine.Unity {
}
if (this.gameObject.activeInHierarchy) {
foreach (var skin in skeleton.Data.Skins) {
foreach (var skin in skeleton.Data.Skins)
AddSkin(skin, skeleton, slotIndex);
AddSkin(skeleton.skin, skeleton, slotIndex);
}
if (BoundingBoxFollower.DebugMessages) {
bool valid = colliderTable.Count != 0;
if (!valid) {
if (this.gameObject.activeInHierarchy)
Debug.LogWarning("Bounding Box Follower not valid! Slot [" + slotName + "] does not contain any Bounding Box Attachments!");
else
Debug.LogWarning("Bounding Box Follower tried to rebuild as a prefab.");
}
}
}
void AddSkin (Skin skin, Skeleton skeleton, int slotIndex) {
var attachmentNames = new List<string>();
skin.FindNamesForSlot(slotIndex, attachmentNames);
@ -133,18 +150,6 @@ namespace Spine.Unity {
}
}
}
}
if (BoundingBoxFollower.DebugMessages) {
bool valid = colliderTable.Count != 0;
if (!valid) {
if (this.gameObject.activeInHierarchy)
Debug.LogWarning("Bounding Box Follower not valid! Slot [" + slotName + "] does not contain any Bounding Box Attachments!");
else
Debug.LogWarning("Bounding Box Follower tried to rebuild as a prefab.");
}
}
}
void OnDisable () {
if (clearStateOnDisable)