From 051537348a6afc86cd4b2a37b8cebf2c6a65245f Mon Sep 17 00:00:00 2001 From: poddav Date: Fri, 29 Apr 2022 13:21:27 +0400 Subject: [PATCH] (Unity): compression method 2 is LZ4 as well. --- ArcFormats/Unity/ArcUnityFS.cs | 1 + ArcFormats/Unity/BundleStream.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ArcFormats/Unity/ArcUnityFS.cs b/ArcFormats/Unity/ArcUnityFS.cs index 8b4c6bed..45a421d2 100644 --- a/ArcFormats/Unity/ArcUnityFS.cs +++ b/ArcFormats/Unity/ArcUnityFS.cs @@ -87,6 +87,7 @@ namespace GameRes.Formats.Unity case 1: index_data = UnpackLzma (packed, index_size); break; + case 2: case 3: index_data = new byte[index_size]; Lz4Compressor.DecompressBlock (packed, packed.Length, index_data, index_data.Length); diff --git a/ArcFormats/Unity/BundleStream.cs b/ArcFormats/Unity/BundleStream.cs index 4483d699..fae4ff7e 100644 --- a/ArcFormats/Unity/BundleStream.cs +++ b/ArcFormats/Unity/BundleStream.cs @@ -118,7 +118,7 @@ namespace GameRes.Formats.Unity m_packed = new byte[segment.PackedSize]; int packed_size = m_input.Read (m_packed, 0, (int)segment.PackedSize); var output = PrepareBuffer (segment.UnpackedSize); - if (3 == method) + if (3 == method || 2 == method) m_buffer_len = Lz4Compressor.DecompressBlock (m_packed, packed_size, output, (int)segment.UnpackedSize); else throw new NotImplementedException ("Not supported Unity asset bundle compression.");