No need to recompute tangents.

This commit is contained in:
NathanSweet 2013-08-29 15:11:41 +02:00
parent d26317ab99
commit 7d7158894d
2 changed files with 6 additions and 3 deletions

1
.gitignore vendored
View File

@ -46,6 +46,7 @@ spine-unity/Library
spine-unity/*.sln
*.userprefs
*.pidb
*.cachefile
Assembly-*.csproj
Assembly-*.pidb

View File

@ -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;
}
}