- Home /
Multiple resource folders in different scenes.
Hi! I have a need to separate scenes like below. My question is, how can i target the correct SFX folder when loading SFXs using Resources.Load("FightSFX/") or Resources.Load("PlatformSFX") ? I mean, is it just like that or do i have to type the whole path from Assets?
@Lautaro-Arino You have to give the complete path for getting this. There is no way that you are looking for.
Answer by Bunny83 · Aug 23, 2016 at 11:33 AM
Uhm you can't "load a folder" with Resources.Load. You can use Resources.LoadAll to load all immediate child assets in a folder. And yes, a resource path is always relative to the Resources folder, so it's just
Resources.LoadAll("FightSFX");
or
Resources.Load("FightSFX/SomeSpecificAsset");
Also keep in mind that a resource path must not have an extension. Only the asset name counts. All Resources folders are considered as one "resource database". So avoid duplicate asset names in different Resources folders.