瀏覽代碼

No need to recompute tangents.

NathanSweet 12 年之前
父節點
當前提交
7d7158894d
共有 2 個文件被更改,包括 6 次插入3 次删除
  1. 1 0
      .gitignore
  2. 5 3
      spine-unity/Assets/Spine/SkeletonComponent.cs

+ 1 - 0
.gitignore

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

+ 5 - 3
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;
 			}
 		}