mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-06-03 00:58:13 -04:00
improve
This commit is contained in:
parent
9d1fd2f945
commit
9ad063bd0a
@ -16,7 +16,7 @@ namespace AssetStudio
|
|||||||
public static Dictionary<string, int> sharedFileIndex = new Dictionary<string, int>(); //to improve the loading speed
|
public static Dictionary<string, int> sharedFileIndex = new Dictionary<string, int>(); //to improve the loading speed
|
||||||
public static Dictionary<string, EndianBinaryReader> resourceFileReaders = new Dictionary<string, EndianBinaryReader>(); //use for read res files
|
public static Dictionary<string, EndianBinaryReader> resourceFileReaders = new Dictionary<string, EndianBinaryReader>(); //use for read res files
|
||||||
public static List<AssetPreloadData> exportableAssets = new List<AssetPreloadData>(); //used to hold all assets while the ListView is filtered
|
public static List<AssetPreloadData> exportableAssets = new List<AssetPreloadData>(); //used to hold all assets while the ListView is filtered
|
||||||
private static HashSet<string> exportableAssetsHash = new HashSet<string>(); //avoid the same name asset
|
private static HashSet<string> assetsNameHash = new HashSet<string>(); //avoid the same name asset
|
||||||
public static List<AssetPreloadData> visibleAssets = new List<AssetPreloadData>(); //used to build the ListView from all or filtered assets
|
public static List<AssetPreloadData> visibleAssets = new List<AssetPreloadData>(); //used to build the ListView from all or filtered assets
|
||||||
public static Dictionary<string, SortedDictionary<int, ClassStruct>> AllClassStructures = new Dictionary<string, SortedDictionary<int, ClassStruct>>();
|
public static Dictionary<string, SortedDictionary<int, ClassStruct>> AllClassStructures = new Dictionary<string, SortedDictionary<int, ClassStruct>>();
|
||||||
public static string mainPath;
|
public static string mainPath;
|
||||||
@ -178,7 +178,6 @@ namespace AssetStudio
|
|||||||
{
|
{
|
||||||
GameObject m_GameObject = new GameObject(asset);
|
GameObject m_GameObject = new GameObject(asset);
|
||||||
assetsFile.GameObjectList.Add(asset.m_PathID, m_GameObject);
|
assetsFile.GameObjectList.Add(asset.m_PathID, m_GameObject);
|
||||||
//totalTreeNodes++;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ClassIDReference.Transform:
|
case ClassIDReference.Transform:
|
||||||
@ -279,24 +278,24 @@ namespace AssetStudio
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (displayAll)
|
|
||||||
{
|
|
||||||
exportable = true;
|
|
||||||
}
|
|
||||||
if (exportable)
|
|
||||||
{
|
|
||||||
if (asset.Text == "")
|
if (asset.Text == "")
|
||||||
{
|
{
|
||||||
asset.Text = asset.TypeString + " #" + asset.uniqueID;
|
asset.Text = asset.TypeString + " #" + asset.uniqueID;
|
||||||
}
|
}
|
||||||
asset.SubItems.AddRange(new[] { asset.TypeString, asset.fullSize.ToString() });
|
asset.SubItems.AddRange(new[] { asset.TypeString, asset.fullSize.ToString() });
|
||||||
//处理同名文件
|
//处理同名文件
|
||||||
if (!exportableAssetsHash.Add((asset.TypeString + asset.Text).ToUpper()))
|
if (!assetsNameHash.Add((asset.TypeString + asset.Text).ToUpper()))
|
||||||
{
|
{
|
||||||
asset.Text += " #" + asset.uniqueID;
|
asset.Text += " #" + asset.uniqueID;
|
||||||
}
|
}
|
||||||
//处理非法文件名
|
//处理非法文件名
|
||||||
asset.Text = FixFileName(asset.Text);
|
asset.Text = FixFileName(asset.Text);
|
||||||
|
if (displayAll)
|
||||||
|
{
|
||||||
|
exportable = true;
|
||||||
|
}
|
||||||
|
if (exportable)
|
||||||
|
{
|
||||||
assetsFile.exportableAssets.Add(asset);
|
assetsFile.exportableAssets.Add(asset);
|
||||||
}
|
}
|
||||||
ProgressBarPerformStep();
|
ProgressBarPerformStep();
|
||||||
@ -317,7 +316,7 @@ namespace AssetStudio
|
|||||||
}
|
}
|
||||||
|
|
||||||
visibleAssets = exportableAssets;
|
visibleAssets = exportableAssets;
|
||||||
exportableAssetsHash.Clear();
|
assetsNameHash.Clear();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -489,6 +488,8 @@ namespace AssetStudio
|
|||||||
exportpath = savePath + "\\" + asset.TypeString + "\\";
|
exportpath = savePath + "\\" + asset.TypeString + "\\";
|
||||||
}
|
}
|
||||||
StatusStripUpdate($"Exporting {asset.TypeString}: {asset.Text}");
|
StatusStripUpdate($"Exporting {asset.TypeString}: {asset.Text}");
|
||||||
|
try
|
||||||
|
{
|
||||||
switch (asset.Type)
|
switch (asset.Type)
|
||||||
{
|
{
|
||||||
case ClassIDReference.Texture2D:
|
case ClassIDReference.Texture2D:
|
||||||
@ -557,6 +558,8 @@ namespace AssetStudio
|
|||||||
exportedCount++;
|
exportedCount++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ClassIDReference.AnimationClip:
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
if (ExportRawFile(asset, exportpath))
|
if (ExportRawFile(asset, exportpath))
|
||||||
{
|
{
|
||||||
@ -565,6 +568,11 @@ namespace AssetStudio
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Export {asset.Type}:{asset.Text} error\r\n{ex.Message}\r\n{ex.StackTrace}");
|
||||||
|
}
|
||||||
ProgressBarPerformStep();
|
ProgressBarPerformStep();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user