Unnoticeably faster frontFacing SkeletonRenderer

Cached slot.bone to remove 3 dereferences.
This commit is contained in:
John 2015-02-07 03:06:57 +08:00
parent a903db829b
commit e85c1b49a0

View File

@ -417,7 +417,8 @@ public class SkeletonRenderer : MonoBehaviour {
for (int i = startSlot, triangleIndex = 0; i < endSlot; i++) {
Slot slot = drawOrder[i];
Attachment attachment = slot.attachment;
bool flip = frontFacing && ((slot.Bone.WorldFlipX != slot.Bone.WorldFlipY) != (Mathf.Sign(slot.Bone.WorldScaleX) != Mathf.Sign(slot.bone.WorldScaleY)));
Bone bone = slot.bone;
bool flip = frontFacing && ((bone.WorldFlipX != bone.WorldFlipY) != (Mathf.Sign(bone.WorldScaleX) != Mathf.Sign(bone.WorldScaleY)));
if (attachment is RegionAttachment) {
if (!flip) {