From 1aec603bba7d51c376ce0f5190158d64f7fb489c Mon Sep 17 00:00:00 2001 From: morkt Date: Sat, 29 Dec 2018 22:30:35 +0400 Subject: [PATCH] (UnityFS): adjusted texture reader. --- ArcFormats/Unity/ArcUnityFS.cs | 2 ++ ArcFormats/Unity/Texture2D.cs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ArcFormats/Unity/ArcUnityFS.cs b/ArcFormats/Unity/ArcUnityFS.cs index 8803d107..8b4c6bed 100644 --- a/ArcFormats/Unity/ArcUnityFS.cs +++ b/ArcFormats/Unity/ArcUnityFS.cs @@ -323,6 +323,8 @@ namespace GameRes.Formats.Unity return ReadTextAsset (file, obj); else if ("Texture2D" == type) type = "image"; + else if ("AssetBundle" == type) + return null; return new AssetEntry { Type = type, diff --git a/ArcFormats/Unity/Texture2D.cs b/ArcFormats/Unity/Texture2D.cs index 35f5f755..ba81ebe9 100644 --- a/ArcFormats/Unity/Texture2D.cs +++ b/ArcFormats/Unity/Texture2D.cs @@ -214,7 +214,8 @@ namespace GameRes.Formats.Unity ImageData Unpack () { - m_texture.LoadData (m_reader); + if (null == m_texture.m_Data || 0 == m_texture.m_Data.Length) + m_texture.LoadData (m_reader); byte[] pixels; switch (m_texture.m_TextureFormat) {