Skip to content

Commit c41910d

Browse files
committed
fixing silly mistakes
1 parent d8515fd commit c41910d

File tree

5 files changed

+14
-21
lines changed

5 files changed

+14
-21
lines changed

AssetTools.NET/Extra/AssetHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static Type_0D FindTypeTreeTypeByScriptIndex(TypeTree typeTree, ushort sc
5757
{
5858
foreach (Type_0D type in typeTree.unity5Types)
5959
{
60-
if (type.classId < 0 && type.scriptIndex == scriptIndex)
60+
if (type.scriptIndex == scriptIndex)
6161
return type;
6262
}
6363
return null;

AssetTools.NET/Extra/AssetsManager/AssetsManager.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -215,17 +215,10 @@ public AssetTypeTemplateField GetTemplateBaseField(AssetsFile file, AssetFileInf
215215
baseField = new AssetTypeTemplateField();
216216
if (hasTypeTree && !forceFromCldb)
217217
{
218-
if (file.header.format < 0x10)
219-
{
220-
if (scriptIndex == 0xFFFF)
221-
baseField.From0D(AssetHelper.FindTypeTreeTypeByID(file.typeTree, fixedId), 0);
222-
else
223-
baseField.From0D(AssetHelper.FindTypeTreeTypeByScriptIndex(file.typeTree, scriptIndex), 0);
224-
}
225-
else
226-
{
218+
if (scriptIndex == 0xFFFF)
227219
baseField.From0D(AssetHelper.FindTypeTreeTypeByID(file.typeTree, fixedId), 0);
228-
}
220+
else
221+
baseField.From0D(AssetHelper.FindTypeTreeTypeByScriptIndex(file.typeTree, scriptIndex), 0);
229222
}
230223
else
231224
{

AssetTools.NET/Extra/BundleHelper.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ public static byte[] LoadAssetDataFromBundle(AssetBundleFile bundle, int index)
2323
public static AssetsFile LoadAssetFromBundle(AssetBundleFile bundle, int index)
2424
{
2525
byte[] data = LoadAssetDataFromBundle(bundle, index);
26-
using (MemoryStream ms = new MemoryStream(data))
27-
using (AssetsFileReader r = new AssetsFileReader(ms))
28-
{
29-
return new AssetsFile(r);
30-
}
26+
MemoryStream ms = new MemoryStream(data);
27+
AssetsFileReader r = new AssetsFileReader(ms);
28+
return new AssetsFile(r);
3129
}
3230
public static AssetsFile LoadAssetFromBundle(AssetBundleFile bundle, string name)
3331
{

AssetsView/Winforms/MonoBehaviourScanner.Designer.cs

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AssetsView/Winforms/StartScreen.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ private void LoadResources(AssetsFileInstance ggm)
225225

226226
AssetExternal assetExt = helper.GetExtAsset(ggm, pointerField, true);
227227
AssetFileInfoEx assetInfo = assetExt.info;
228+
if (assetInfo == null)
229+
continue;
228230
ClassDatabaseType assetType = AssetHelper.FindAssetClassByID(helper.classFile, assetInfo.curFileType);
229231
if (assetType == null)
230232
continue;

0 commit comments

Comments
 (0)