diff --git a/AssetStudioCLI/Exporter.cs b/AssetStudioCLI/Exporter.cs index 5751daf..83c6eb0 100644 --- a/AssetStudioCLI/Exporter.cs +++ b/AssetStudioCLI/Exporter.cs @@ -160,6 +160,27 @@ namespace AssetStudioCLI { if (!TryExportFile(exportPath, item, ".dat", out var exportFullPath, mode: "ExportRaw")) return false; + switch (item.Asset) + { + case Texture2D m_Texture2D: + if (!string.IsNullOrEmpty(m_Texture2D.m_StreamData?.path)) + { + File.WriteAllBytes(exportFullPath.Replace(".dat", "_data.dat"), m_Texture2D.image_data.GetData()); + } + break; + case AudioClip m_AudioClip: + if (!string.IsNullOrEmpty(m_AudioClip.m_Source)) + { + File.WriteAllBytes(exportFullPath.Replace(".dat", "_data.dat"), m_AudioClip.m_AudioData.GetData()); + } + 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()); + } + break; + } File.WriteAllBytes(exportFullPath, item.Asset.GetRawData()); Logger.Debug($"{item.TypeString} \"{item.Text}\" exported to \"{exportFullPath}\""); diff --git a/AssetStudioGUI/Exporter.cs b/AssetStudioGUI/Exporter.cs index b638c36..a6f27a2 100644 --- a/AssetStudioGUI/Exporter.cs +++ b/AssetStudioGUI/Exporter.cs @@ -187,6 +187,27 @@ namespace AssetStudioGUI { if (!TryExportFile(exportPath, item, ".dat", out var exportFullPath, mode: "ExportRaw")) return false; + switch (item.Asset) + { + case Texture2D m_Texture2D: + if (!string.IsNullOrEmpty(m_Texture2D.m_StreamData?.path)) + { + File.WriteAllBytes(exportFullPath.Replace(".dat", "_data.dat"), m_Texture2D.image_data.GetData()); + } + break; + case AudioClip m_AudioClip: + if (!string.IsNullOrEmpty(m_AudioClip.m_Source)) + { + File.WriteAllBytes(exportFullPath.Replace(".dat", "_data.dat"), m_AudioClip.m_AudioData.GetData()); + } + 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()); + } + break; + } File.WriteAllBytes(exportFullPath, item.Asset.GetRawData()); return true; }