away3d/away3d-core-fp11

NamedAssetBase's namespace should be DEFAULT_NAMESPACE by default (or AssetLibrary.removeAssetFromDict() should auto-default)

Opened this issue · 0 comments

I am using a third-party loader to create BitmapTextures and manually adding them to an AssetBundle.

However, when manually creating an instance of NamedAssetBase, its _namespace property is null, rather than DEFAULT_NAMESPACE.

I've found this to cause issues with AssetLibraryBundle further down the line when manually adding and removing assets: i.e. in AssetLibraryBundle.addAsset(), if the asset's namespace is null it is added to the dictionary's DEFAULT_NAMESPACE ("default"). However, in AssetLibraryBundle.removeAssetFromDict() the assets namespace isn't defaulted, and therefore the asset is not found and not removed.

I've found a workaround, which is to call texture.resetAssetPath(texture.name, NamedAssetBase.DEFAULT_NAMESPACE, false); before adding it to the bundle, but this shouldn't have to be the case.