From 9024e6a2351ebdc24c774758358707e5db74cdfd Mon Sep 17 00:00:00 2001 From: VaDiM Date: Mon, 24 Feb 2025 19:00:50 +0300 Subject: [PATCH] Improve external data extraction for ExportRaw mode --- AssetStudioCLI/Exporter.cs | 6 +++--- AssetStudioGUI/Exporter.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/AssetStudioCLI/Exporter.cs b/AssetStudioCLI/Exporter.cs index 83c6eb0..131dbea 100644 --- a/AssetStudioCLI/Exporter.cs +++ b/AssetStudioCLI/Exporter.cs @@ -165,19 +165,19 @@ namespace AssetStudioCLI case Texture2D m_Texture2D: if (!string.IsNullOrEmpty(m_Texture2D.m_StreamData?.path)) { - File.WriteAllBytes(exportFullPath.Replace(".dat", "_data.dat"), m_Texture2D.image_data.GetData()); + m_Texture2D.image_data.WriteData(exportFullPath.Replace(".dat", "_data.dat")); } break; case AudioClip m_AudioClip: if (!string.IsNullOrEmpty(m_AudioClip.m_Source)) { - File.WriteAllBytes(exportFullPath.Replace(".dat", "_data.dat"), m_AudioClip.m_AudioData.GetData()); + m_AudioClip.m_AudioData.WriteData(exportFullPath.Replace(".dat", "_data.dat")); } break; case VideoClip m_VideoClip: if (!string.IsNullOrEmpty(m_VideoClip.m_ExternalResources.m_Source)) { - File.WriteAllBytes(exportFullPath.Replace(".dat", "_data.dat"), m_VideoClip.m_VideoData.GetData()); + m_VideoClip.m_VideoData.WriteData(exportFullPath.Replace(".dat", "_data.dat")); } break; } diff --git a/AssetStudioGUI/Exporter.cs b/AssetStudioGUI/Exporter.cs index a6f27a2..c74adfe 100644 --- a/AssetStudioGUI/Exporter.cs +++ b/AssetStudioGUI/Exporter.cs @@ -192,19 +192,19 @@ namespace AssetStudioGUI case Texture2D m_Texture2D: if (!string.IsNullOrEmpty(m_Texture2D.m_StreamData?.path)) { - File.WriteAllBytes(exportFullPath.Replace(".dat", "_data.dat"), m_Texture2D.image_data.GetData()); + m_Texture2D.image_data.WriteData(exportFullPath.Replace(".dat", "_data.dat")); } break; case AudioClip m_AudioClip: if (!string.IsNullOrEmpty(m_AudioClip.m_Source)) { - File.WriteAllBytes(exportFullPath.Replace(".dat", "_data.dat"), m_AudioClip.m_AudioData.GetData()); + m_AudioClip.m_AudioData.WriteData(exportFullPath.Replace(".dat", "_data.dat")); } break; case VideoClip m_VideoClip: if (!string.IsNullOrEmpty(m_VideoClip.m_ExternalResources.m_Source)) { - File.WriteAllBytes(exportFullPath.Replace(".dat", "_data.dat"), m_VideoClip.m_VideoData.GetData()); + m_VideoClip.m_VideoData.WriteData(exportFullPath.Replace(".dat", "_data.dat")); } break; }