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 spine-unity/*.sln
*.userprefs *.userprefs
*.pidb *.pidb
*.cachefile
Assembly-*.csproj Assembly-*.csproj
Assembly-*.pidb Assembly-*.pidb

View File

@ -196,9 +196,11 @@ public class SkeletonComponent : MonoBehaviour {
if (calculateTangents) { if (calculateTangents) {
Vector4[] tangents = this.tangents; Vector4[] tangents = this.tangents;
int count = mesh.normals.Length; int count = mesh.normals.Length;
if (tangents.Length != count) this.tangents = tangents = new Vector4[count]; if (tangents.Length != count) {
for (int i = 0; i < count; i++) this.tangents = tangents = new Vector4[count];
tangents[i] = new Vector4(1, 0, 0, 1); for (int i = 0; i < count; i++)
tangents[i] = new Vector4(1, 0, 0, 1);
}
mesh.tangents = tangents; mesh.tangents = tangents;
} }
} }