Fixes for Unity version parser

This commit is contained in:
VaDiM
2024-09-27 16:43:06 +03:00
parent 5a84a67955
commit c93d27d9a4
5 changed files with 14 additions and 23 deletions

View File

@ -266,7 +266,7 @@ namespace AssetStudioGUI
var typeMap = await Task.Run(() => BuildClassStructure());
productName = string.IsNullOrEmpty(productName) ? "no productName" : productName;
Text = $"{guiTitle} - {productName} - {assetsManager.assetsFileList[0].unityVersion} - {assetsManager.assetsFileList[0].m_TargetPlatform}";
Text = $"{guiTitle} - {productName} - {assetsManager.assetsFileList[0].version} - {assetsManager.assetsFileList[0].m_TargetPlatform}";
assetListView.VirtualListSize = visibleAssets.Count;
@ -278,7 +278,7 @@ namespace AssetStudioGUI
classesListView.BeginUpdate();
foreach (var version in typeMap)
{
var versionGroup = new ListViewGroup(version.Key);
var versionGroup = new ListViewGroup(version.Key.FullVersion);
classesListView.Groups.Add(versionGroup);
foreach (var uclass in version.Value)

View File

@ -429,12 +429,12 @@ namespace AssetStudioGUI
return (productName, treeNodeCollection);
}
public static Dictionary<string, SortedDictionary<int, TypeTreeItem>> BuildClassStructure()
public static Dictionary<UnityVersion, SortedDictionary<int, TypeTreeItem>> BuildClassStructure()
{
var typeMap = new Dictionary<string, SortedDictionary<int, TypeTreeItem>>();
var typeMap = new Dictionary<UnityVersion, SortedDictionary<int, TypeTreeItem>>();
foreach (var assetsFile in assetsManager.assetsFileList)
{
if (typeMap.TryGetValue(assetsFile.unityVersion, out var curVer))
if (typeMap.TryGetValue(assetsFile.version, out var curVer))
{
foreach (var type in assetsFile.m_Types.Where(x => x.m_Type != null))
{
@ -458,7 +458,7 @@ namespace AssetStudioGUI
}
items[key] = new TypeTreeItem(key, type.m_Type);
}
typeMap.Add(assetsFile.unityVersion, items);
typeMap.Add(assetsFile.version, items);
}
}
return typeMap;