Is there a way to list resource assets 'nativeUrl' without downloading it?

Hi,

I would like to get all the ‘nativeUrl’ of resource/assets folder without downloading the assets them. Just listing the nativeUrl for every file in that resource folder.

Using:

cc.loader.loadResDir('url/to/asset/folder', (err, asset) => {
  cc.log(asset.nativeUrl);
});

I can get the nativeUrl, but I want to get it without downloading the file.

The reason I don’t want to download the file is that I have to use howler.js instead of CC audioEngine, because it has too many bugs and missing features in it. Howler has its own loading system using the nativeUrl. I would not like to download the files once with cc.loader, just to be able to get the nativeUrl.

The asset could be in resource/sounds/music.ogg while the nativeUrl becomes something similar to /res/import/b8/b8bffb35-7498-4179-ab22-8b527eb1c8ea.oggusing UUID.

How can I loop though a resource folder and convert assets into their UUID paths?

I’m using cc1.10 version.

@jare I’m sorry to tag you, but I’m sure you know this :slightly_smiling_face:

Thanks!

This is what I want somehow:

image

var uuids = resources.getUuidArray(url, type, urls);

Have to figure out how to get the resources object. Any tips?

@pandamicro I’ve seen you been active here on the English forum side. Maybe you have just a small hint for me in the right direction? This would save a lot of time for me :slightly_smiling_face:

Thank you so much in advance!

This should be quite straight forward to get from a resourde folder, right? Could anyone please help?

it might not be what you are looking for, but have you tried cc.loader._cache ?

Thank you @skara for helping me!

I looked through the output of cc.loader._cache and it is already here transformed into the UUID filenames :frowning:, like this:

I would need to be able to find out all of the built UUID filenames and locations from a specific resource/folder without having to download them.

Otherwise I should just put them outside of the Asset folder I guess