From 7d7158894d61c3b37495008ea1f12838d2bebc22 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Thu, 29 Aug 2013 15:11:41 +0200 Subject: [PATCH] No need to recompute tangents. --- .gitignore | 1 + spine-unity/Assets/Spine/SkeletonComponent.cs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 72b73798b..bfc13b0a5 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ spine-unity/Library spine-unity/*.sln *.userprefs *.pidb +*.cachefile Assembly-*.csproj Assembly-*.pidb diff --git a/spine-unity/Assets/Spine/SkeletonComponent.cs b/spine-unity/Assets/Spine/SkeletonComponent.cs index c0f31f868..3a2eaa746 100644 --- a/spine-unity/Assets/Spine/SkeletonComponent.cs +++ b/spine-unity/Assets/Spine/SkeletonComponent.cs @@ -196,9 +196,11 @@ public class SkeletonComponent : MonoBehaviour { if (calculateTangents) { Vector4[] tangents = this.tangents; int count = mesh.normals.Length; - if (tangents.Length != count) this.tangents = tangents = new Vector4[count]; - for (int i = 0; i < count; i++) - tangents[i] = new Vector4(1, 0, 0, 1); + if (tangents.Length != count) { + this.tangents = tangents = new Vector4[count]; + for (int i = 0; i < count; i++) + tangents[i] = new Vector4(1, 0, 0, 1); + } mesh.tangents = tangents; } }