You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`AssetsManager manager = new AssetsManager();
var bunInst = manager.LoadBundleFile(bundlePath);
var bun = bunInst.file;
int fileTotal = bun.GetAllFileNames().Count;
for(int i = 0; i<fileTotal; i++)
{
var afileInst = manager.LoadAssetsFileFromBundle(bunInst, i, true);
var afile = afileInst.file;
foreach(var texInfo in afile.GetAssetsOfType(AssetClassID.Texture2D))
{
var texBase = manager.GetBaseField(afileInst, texInfo);
.......
}
}`
For AB contains both texture2D and Sprite assets, there is a NullReferenceException:Object reference not set to an instance of an object. AssetsTools.NET.Extra.AssetsManager.GetTemplateBaseField.
AssetsTools.NET.Extra.AssetsReadFlags.readFlags.
AssetsTools.NET.Extra.AssetsManager.GetTemplateBaseField.
For AB only contains texture2D asset it goes well and modified all the texture2D name successfully
The text was updated successfully, but these errors were encountered:
GetTemplateBaseField is a big method so it could be anywhere. I doubt it has to do with sprites being in the bundle. Maybe check if your bundle has a type tree with afile.Metadata.TypeTreeEnabled? If it's not enabled, you need to load a tpk.
`AssetsManager manager = new AssetsManager();
var bunInst = manager.LoadBundleFile(bundlePath);
var bun = bunInst.file;
int fileTotal = bun.GetAllFileNames().Count;
for(int i = 0; i<fileTotal; i++)
{
var afileInst = manager.LoadAssetsFileFromBundle(bunInst, i, true);
var afile = afileInst.file;
foreach(var texInfo in afile.GetAssetsOfType(AssetClassID.Texture2D))
{
var texBase = manager.GetBaseField(afileInst, texInfo);
.......
}
}`
For AB contains both texture2D and Sprite assets, there is a NullReferenceException:Object reference not set to an instance of an object. AssetsTools.NET.Extra.AssetsManager.GetTemplateBaseField.
AssetsTools.NET.Extra.AssetsReadFlags.readFlags.
AssetsTools.NET.Extra.AssetsManager.GetTemplateBaseField.
For AB only contains texture2D asset it goes well and modified all the texture2D name successfully
The text was updated successfully, but these errors were encountered: