Эх сурвалжийг харах

Merge remote-tracking branch 'origin/master'

NathanSweet 11 жил өмнө
parent
commit
03020e0ff4

+ 1 - 1
spine-starling/spine-starling/src/spine/starling/PolygonBatch.as

@@ -125,7 +125,7 @@ internal class PolygonBatch {
 			_support.applyBlendMode(true);
 		}
 
-		if (texture != _texture) {
+		if (!_texture || texture.base != _texture.base) {
 			flush();
 			_texture = texture;
 		}

+ 4 - 4
spine-starling/spine-starling/src/spine/starling/SkeletonSprite.as

@@ -243,10 +243,10 @@ public class SkeletonSprite extends DisplayObject {
 				continue;
 			for (var ii:int = 0; ii < verticesLength; ii += 2) {
 				var x:Number = worldVertices[ii], y:Number = worldVertices[ii + 1];
-				minX = Math.min(minX, x);
-				minY = Math.min(minY, y);
-				maxX = Math.max(maxX, x);
-				maxY = Math.max(maxY, y);
+				minX = minX < x ? minX : x;
+				minY = minY < y ? minY : y;
+				maxX = maxX > x ? maxX : x;
+				maxY = maxY > y ? maxY : y;
 			}
 		}
 

+ 8 - 2
spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs

@@ -368,8 +368,12 @@ public class SpineEditorUtilities : AssetPostprocessor {
 
 		AtlasAsset atlasAsset = AtlasAsset.CreateInstance<AtlasAsset>();
 		atlasAsset.atlasFile = atlasText;
-		
-		string[] atlasLines = atlasText.text.Split('\n');
+
+        //strip CR
+        string atlasStr = atlasText.text;
+        atlasStr = atlasStr.Replace("\r", "");
+
+		string[] atlasLines = atlasStr.Split('\n');
 		List<string> pageFiles = new List<string>();
 		for(int i = 0; i < atlasLines.Length-1; i++){
 			if(atlasLines[i].Length == 0)
@@ -385,6 +389,8 @@ public class SpineEditorUtilities : AssetPostprocessor {
 			TextureImporter texImporter = (TextureImporter)TextureImporter.GetAtPath(texturePath);
 			texImporter.textureFormat = TextureImporterFormat.AutomaticTruecolor;
 			texImporter.mipmapEnabled = false;
+            //TODO: Get actual size from atlas data
+            texImporter.maxTextureSize = 2048;
 			EditorUtility.SetDirty(texImporter);
 			AssetDatabase.ImportAsset(texturePath);
 			AssetDatabase.SaveAssets();