From ab5f5fbd9dcccb75b820fe97ac0113798bca203e Mon Sep 17 00:00:00 2001 From: Perfare Date: Thu, 22 Nov 2018 12:17:16 +0800 Subject: [PATCH] Restore the extension of TextAsset Export Animator to a separate folder --- AssetStudioGUI/Components/AssetItem.cs | 1 + AssetStudioGUI/Exporter.cs | 4 ++-- AssetStudioGUI/Studio.cs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AssetStudioGUI/Components/AssetItem.cs b/AssetStudioGUI/Components/AssetItem.cs index 1245cd7..4c1c802 100644 --- a/AssetStudioGUI/Components/AssetItem.cs +++ b/AssetStudioGUI/Components/AssetItem.cs @@ -11,6 +11,7 @@ namespace AssetStudioGUI public ClassIDType Type; public string TypeString; + public string Extension; public string InfoText; public string UniqueID; public GameObjectTreeNode TreeNode; diff --git a/AssetStudioGUI/Exporter.cs b/AssetStudioGUI/Exporter.cs index 284ab58..f861409 100644 --- a/AssetStudioGUI/Exporter.cs +++ b/AssetStudioGUI/Exporter.cs @@ -90,7 +90,7 @@ namespace AssetStudioGUI public static bool ExportTextAsset(AssetItem item, string exportPath) { var m_TextAsset = (TextAsset)(item.Asset); - var exportFullName = exportPath + item.Text + ".txt"; + var exportFullName = exportPath + item.Text + (item.Extension ?? ".txt"); if (ExportFileExists(exportFullName)) return false; File.WriteAllBytes(exportFullName, m_TextAsset.m_Script); @@ -285,7 +285,7 @@ namespace AssetStudioGUI { var m_Animator = (Animator)item.Asset; var convert = animationList != null ? new ModelConverter(m_Animator, animationList.Select(x => (AnimationClip)x.Asset).ToArray()) : new ModelConverter(m_Animator); - exportPath = exportPath + item.Text + ".fbx"; + exportPath = $"{exportPath}{item.Text}\\{item.Text}.fbx"; return ExportFbx(convert, exportPath); } diff --git a/AssetStudioGUI/Studio.cs b/AssetStudioGUI/Studio.cs index 95e7f87..cfec47d 100644 --- a/AssetStudioGUI/Studio.cs +++ b/AssetStudioGUI/Studio.cs @@ -210,7 +210,7 @@ namespace AssetStudioGUI var extension = Path.GetExtension(originalPath); if (!string.IsNullOrEmpty(extension) && item.Type == ClassIDType.TextAsset) { - //asset.Extension = extension; //TODO + item.Extension = extension; } item.Text = Path.GetDirectoryName(originalPath) + "\\" + item.Text;