Skip to content

Commit

Permalink
bug fixes from various reports
Browse files Browse the repository at this point in the history
  • Loading branch information
nesrak1 committed Jan 28, 2022
1 parent 04aa310 commit b4b3629
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
6 changes: 6 additions & 0 deletions AssetTools.NET/Extra/AssetsManager/AssetsFileInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ public AssetsFileInstance GetDependency(AssetsManager am, int depIdx)
if (dependencies[depIdx] == null)
{
string depPath = file.dependencies.dependencies[depIdx].assetPath;

if (depPath == string.Empty)
{
return null;
}

int instIndex = am.files.FindIndex(f => Path.GetFileName(f.path).ToLower() == Path.GetFileName(depPath).ToLower());
if (instIndex == -1)
{
Expand Down
2 changes: 2 additions & 0 deletions AssetTools.NET/Standard/AssetTypeClass/AssetTypeValueField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public static EnumValueTypes GetValueTypeByTypeName(string type)
return EnumValueTypes.Double;
case "bool":
return EnumValueTypes.Bool;
case "typelessdata":
return EnumValueTypes.ByteArray;
default:
return EnumValueTypes.None;
}
Expand Down
11 changes: 9 additions & 2 deletions AssetsView/Winforms/GameObjectViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ private void PopulateDataGrid(AssetTypeValueField atvf, PGProperty node, AssetFi
node.Add(prop);
PopulateDataGrid(atvfc, prop, info, category);
}
else if (evt == EnumValueTypes.Array ||
evt == EnumValueTypes.ByteArray)
else if (evt == EnumValueTypes.Array)
{
PGProperty childProps = new PGProperty("child", null, $"[size: {atvfc.childrenCount}]");
PGProperty prop = new PGProperty(key, childProps, $"[size: {atvfc.childrenCount}]");
Expand All @@ -224,6 +223,14 @@ private void PopulateDataGrid(AssetTypeValueField atvf, PGProperty node, AssetFi
node.Add(prop);
PopulateDataGrid(atvfc, childProps, info, category, true);
}
else if (evt == EnumValueTypes.ByteArray)
{
PGProperty childProps = new PGProperty("child", null, $"[bytes size: {atvfc.GetValue().AsByteArray().size}]");
PGProperty prop = new PGProperty(key, childProps, $"[bytes size: {atvfc.GetValue().AsByteArray().size}]");
prop.category = category;
SetSelectedStateIfSelected(info, prop);
node.Add(prop);
}
}
}
else
Expand Down
8 changes: 6 additions & 2 deletions AssetsView/Winforms/TextureViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ public TextureViewer(AssetsFileInstance inst, AssetTypeValueField baseField)

//bundle resS
TextureFile.StreamingInfo streamInfo = tf.m_StreamData;
if (streamInfo.path != null && streamInfo.path.StartsWith("archive:/") && inst.parentBundle != null)
if (streamInfo.path != null && inst.parentBundle != null)
{
string searchPath = streamInfo.path.Substring(9);
string searchPath = streamInfo.path;

if (streamInfo.path.StartsWith("archive:/"))
searchPath = searchPath.Substring(9);

searchPath = Path.GetFileName(searchPath);

AssetBundleFile bundle = inst.parentBundle.file;
Expand Down

0 comments on commit b4b3629

Please sign in to comment.