Browse Source

Clean up.

NathanSweet 11 years ago
parent
commit
14aeb49650
2 changed files with 6 additions and 9 deletions
  1. 1 2
      spine-csharp/src/Bone.cs
  2. 5 7
      spine-unity/Assets/spine-unity/AtlasAsset.cs

+ 1 - 2
spine-csharp/src/Bone.cs

@@ -38,7 +38,7 @@ namespace Spine {
 		internal BoneData data;
 		internal Skeleton skeleton;
 		internal Bone parent;
-		internal List<Bone> children;
+		internal List<Bone> children = new List<Bone>();
 		internal float x, y, rotation, rotationIK, scaleX, scaleY;
 		internal bool flipX, flipY;
 		internal float m00, m01, m10, m11;
@@ -79,7 +79,6 @@ namespace Spine {
 			this.data = data;
 			this.skeleton = skeleton;
 			this.parent = parent;
-			this.children = new List<Bone>();
 			SetToSetupPose();
 		}
 

+ 5 - 7
spine-unity/Assets/spine-unity/AtlasAsset.cs

@@ -97,13 +97,11 @@ public class MaterialsTextureLoader : TextureLoader {
 		}
 		page.rendererObject = material;
 
-        //deal with really, really old atlas files
-        if (page.width == 0 || page.height == 0)
-        {
-            page.width = material.mainTexture.width;
-            page.height = material.mainTexture.height;
-        }
-        
+		// Very old atlas files expected the texture's actual size to be used at runtime.
+		if (page.width == 0 || page.height == 0) {
+			page.width = material.mainTexture.width;
+			page.height = material.mainTexture.height;
+		}
 	}
 
 	public void Unload (object texture) {