ContentManager.Exists returns true for an asset that wasn't loaded yet #325
Comments
As far as I am aware, this method doesn't check if an asset is loaded, but it checks if an asset exists and it can be loaded. |
If that's the case, would it make sense to add "IsLoaded" to check whether or not an asset was already loaded (exists in loadedAssets)? |
I am not sure if this would add much value, as ContentManager ensures that the asset is loaded only once, and repeated Load calls will not load the asset several times. |
I'm writing an async version that derives the ContentManager. It would be easy to handle scenarios where I have to add <Type, string> into a queue of assets to be loaded if I could simply do Exists(asset). Not a big deal though. |
Maybe it would help more if we would make protected some of private methods in ContentManager? This will allow extensibility, however will not add a confusing |
The above scenario requires only |
… easier extensibility (issue #325).
I made some members protected in the changeset above, however I am not sure if I fully understood your usage scenario. If these changes are ok - close the issue, otherwise - post a code fragment from which we can understand what you need to achieve. |
ContentManager.Exists("someAsset") called before Content.Load("someAsset") returns true. Looking at the code it appears to me that the ContentManager is not checking whether or not the asset is in loadedAssets, but only checks the registered content resolvers.
The text was updated successfully, but these errors were encountered: