From 521cb34541009edadd155a8d41e9bcdfa4200e93 Mon Sep 17 00:00:00 2001 From: max Date: Tue, 14 Jan 2020 19:42:30 +0100 Subject: [PATCH] Bugfixes: Texture width as height & build errors. Bugfixes: Texture width as height typo and project build errors. --- .../Scripts/Data/MA_TextureAtlasserProExportSettings.cs | 6 ++++-- .../MA_ToolBox/MA_Utilities/TextureUtils/MA_TextureUtils.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Assets/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProExportSettings.cs b/Assets/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProExportSettings.cs index 4721e74..5303868 100644 --- a/Assets/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProExportSettings.cs +++ b/Assets/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProExportSettings.cs @@ -1,4 +1,5 @@ -using UnityEngine; +#if UNITY_EDITOR +using UnityEngine; using System.Collections; using MA_Texture; using System.Collections.Generic; @@ -66,4 +67,5 @@ namespace MA_TextureAtlasserPro Sprite, SpriteSliced } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Assets/MA_ToolBox/MA_Utilities/TextureUtils/MA_TextureUtils.cs b/Assets/MA_ToolBox/MA_Utilities/TextureUtils/MA_TextureUtils.cs index a66b370..10c7a99 100644 --- a/Assets/MA_ToolBox/MA_Utilities/TextureUtils/MA_TextureUtils.cs +++ b/Assets/MA_ToolBox/MA_Utilities/TextureUtils/MA_TextureUtils.cs @@ -41,7 +41,7 @@ namespace MA_Texture RenderTexture.active = tmp; // Create a new readable Texture2D to copy the pixels to it - Texture2D myTexture2D = new Texture2D(texture.width, texture.width); + Texture2D myTexture2D = new Texture2D(texture.width, texture.height); // Copy the pixels from the RenderTexture to the new Texture myTexture2D.ReadPixels(new Rect(0, 0, tmp.width, tmp.height), 0, 0);