mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-07-14 02:54:16 -04:00
Show/Export object dump if typetree dump is not available
This commit is contained in:
@ -286,7 +286,7 @@ namespace AssetStudioGUI
|
||||
filterTypeToolStripMenuItem.DropDownItems.Add(typeItem);
|
||||
}
|
||||
allToolStripMenuItem.Checked = true;
|
||||
var log = $"Finished loading {assetsManager.assetsFileList.Count} files with {assetListView.Items.Count} exportable assets";
|
||||
var log = $"Finished loading {assetsManager.assetsFileList.Count} file(s) with {assetListView.Items.Count} exportable assets";
|
||||
var unityVer = assetsManager.assetsFileList[0].version;
|
||||
var m_ObjectsCount = unityVer[0] > 2020 ?
|
||||
assetsManager.assetsFileList.Sum(x => x.m_Objects.LongCount(y => y.classID != (int)ClassIDType.Shader)) :
|
||||
|
@ -359,6 +359,10 @@ namespace AssetStudioGUI
|
||||
var m_Type = Studio.MonoBehaviourToTypeTree(m_MonoBehaviour);
|
||||
str = m_MonoBehaviour.Dump(m_Type);
|
||||
}
|
||||
if (string.IsNullOrEmpty(str))
|
||||
{
|
||||
str = item.Asset.DumpObject();
|
||||
}
|
||||
if (str != null)
|
||||
{
|
||||
File.WriteAllText(exportFullPath, str);
|
||||
|
@ -486,7 +486,8 @@ namespace AssetStudioGUI
|
||||
break;
|
||||
}
|
||||
exportPath += Path.DirectorySeparatorChar;
|
||||
Logger.Info($"[{exportedCount + 1}/{toExportCount}] Exporting {asset.TypeString}: {asset.Text}");
|
||||
var mode = exportType == ExportType.Dump ? "Dumping" : "Exporting";
|
||||
Logger.Info($"[{exportedCount + 1}/{toExportCount}] {mode} {asset.TypeString}: {asset.Text}");
|
||||
try
|
||||
{
|
||||
switch (exportType)
|
||||
@ -785,6 +786,10 @@ namespace AssetStudioGUI
|
||||
var type = MonoBehaviourToTypeTree(m_MonoBehaviour);
|
||||
str = m_MonoBehaviour.Dump(type);
|
||||
}
|
||||
if (string.IsNullOrEmpty(str))
|
||||
{
|
||||
str = obj.DumpObject();
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user