Hi guys,
I have the following problem: I registered a custom class, VirtualAssetLocator, to the application’s asset manager to handle resources from a particular path, “VIRTUAL/”. That works good, but since I did it, this asset locator is called by when the asset manager is requested to load resources from a different path, “core/button.mesh.xml”. If I don’t register my asset locator, button.mesh.xml is found.
Am I doing something wrong or this is a bug?
Thanks!
Oh, I see. I can achieve the behavior I want now, thanks!
By the way, what is the path for then? I assumed the asset manager uses the path to pick a locator but that is not the case right?
You have to return null if your asset locator cannot provide the source.
Hope this helps,
Normen
Well the assetLocator is there to provide an InputStream for a resource if it can. So if you have an AssetLocator for a zip file for example, it should return null so that when the file is not in the zip the FileLocator that you registered on some folder will be “asked” as well. Finally the assetManager tries to find the asset on the classpath, if its not getting something there it will return an error. The “rootPath” that you get supplied is just an indicator on how you should use “your” path. So for example a ZipLocator could only provide models from a certain path of the zip file.
Cheers,
Normen
Understood, well explained Normen.
Thanks once more!