Răsfoiți Sursa

Merge remote-tracking branch 'origin/3.6' into 3.6

NathanSweet 8 ani în urmă
părinte
comite
97bedf22bb

+ 12 - 1
spine-unity/Assets/spine-unity/Asset Types/Editor/AtlasAssetInspector.cs

@@ -120,7 +120,7 @@ namespace Spine.Unity.Editor {
 			}
 
 			if (materials.arraySize == 0) {
-				EditorGUILayout.HelpBox("Missing materials", MessageType.Error);
+				EditorGUILayout.HelpBox("No materials", MessageType.Error);
 				return;
 			}
 
@@ -133,6 +133,15 @@ namespace Spine.Unity.Editor {
 				}
 			}
 
+			EditorGUILayout.Space();
+			if (SpineInspectorUtility.LargeCenteredButton(SpineInspectorUtility.TempContent("Set Mipmap Bias to " + SpineEditorUtilities.DEFAULT_MIPMAPBIAS))) {
+				foreach (var m in atlasAsset.materials) {
+					var texture = m.mainTexture;
+					texture.mipMapBias = SpineEditorUtilities.DEFAULT_MIPMAPBIAS;
+				}
+				Debug.Log("Texture mipmap bias set to " + SpineEditorUtilities.DEFAULT_MIPMAPBIAS);
+			}
+
 			EditorGUILayout.Space();
 			if (atlasFile.objectReferenceValue != null) {
 				if (SpineInspectorUtility.LargeCenteredButton(SpriteSlicesLabel)) {
@@ -142,6 +151,8 @@ namespace Spine.Unity.Editor {
 				}
 			}
 
+			EditorGUILayout.Space();
+
 			#if REGION_BAKING_MESH
 			if (atlasFile.objectReferenceValue != null) {
 				Atlas atlas = asset.GetAtlas();

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

@@ -188,6 +188,8 @@ namespace Spine.Unity.Editor {
 		const string SHOW_HIERARCHY_ICONS_KEY = "SPINE_SHOW_HIERARCHY_ICONS";
 		public static bool showHierarchyIcons = DEFAULT_SHOW_HIERARCHY_ICONS;
 
+		internal const float DEFAULT_MIPMAPBIAS = -0.5f;
+
 		public const float DEFAULT_SCENE_ICONS_SCALE = 1f;
 		public const string SCENE_ICONS_SCALE_KEY = "SPINE_SCENE_ICONS_SCALE";
 

+ 2 - 0
spine-unity/Assets/spine-unity/Modules/AttachmentTools/AttachmentTools.cs

@@ -212,6 +212,7 @@ namespace Spine.Unity.Modules.AttachmentTools {
 
 	public static class SpriteAtlasRegionExtensions {
 		internal const TextureFormat SpineTextureFormat = TextureFormat.RGBA32;
+		internal const float DefaultMipmapBias = -0.5f;
 		internal const bool UseMipMaps = false;
 		internal const float DefaultScale = 0.01f;
 
@@ -440,6 +441,7 @@ namespace Spine.Unity.Modules.AttachmentTools {
 
 			// Fill a new texture with the collected attachment textures.
 			var newTexture = new Texture2D(maxAtlasSize, maxAtlasSize, textureFormat, mipmaps);
+			newTexture.mipMapBias = SpriteAtlasRegionExtensions.DefaultMipmapBias;
 			newTexture.anisoLevel = texturesToPack[0].anisoLevel;
 			newTexture.name = newName;
 			var rects = newTexture.PackTextures(texturesToPack.ToArray(), padding, maxAtlasSize);