From a400ee3bf20b93e4390b0ddf0d67c7ca310a514d Mon Sep 17 00:00:00 2001 From: John Date: Wed, 16 Nov 2016 10:40:14 +0800 Subject: [PATCH] [unity] Handle obsolete TextureImporter API in 5.5 --- .../Assets/spine-unity/Editor/SpineEditorUtilities.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs b/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs index 440d3db09..f447337e0 100644 --- a/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs +++ b/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs @@ -28,8 +28,6 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#pragma warning disable 0219 - // Contributed by: Mitch Thompson #define SPINE_SKELETONANIMATOR @@ -929,10 +927,15 @@ namespace Spine.Unity.Editor { Texture2D texture = (Texture2D)AssetDatabase.LoadAssetAtPath(texturePath, typeof(Texture2D)); TextureImporter texImporter = (TextureImporter)TextureImporter.GetAtPath(texturePath); + #if UNITY_5_5_OR_NEWER + texImporter.textureCompression = TextureImporterCompression.Uncompressed; + texImporter.alphaSource = TextureImporterAlphaSource.FromInput; + #else texImporter.textureType = TextureImporterType.Advanced; texImporter.textureFormat = TextureImporterFormat.AutomaticTruecolor; + #endif texImporter.mipmapEnabled = false; - texImporter.alphaIsTransparency = false; + texImporter.alphaIsTransparency = false; // Prevent the texture importer from applying bleed to the transparent parts. texImporter.spriteImportMode = SpriteImportMode.None; texImporter.maxTextureSize = 2048;