Resources.Load("folder1/folder2/assetName", GameOb

I don’t seem to be able to do this with Trial license. Am I supposed to just dump everything into one giant mess of a folder called ‘Resources’ or is it possible to use a directory structure?

I am trying to categorize my assets based on what ‘room’ they are in:

Resources->ThirdFloor->JohnRoom->
ambientMusic1
ambientMusic2
JohnRoom(prefab)
JohnRoomScript
Trigger_Exit_Corridors_Script

etc

All of the ‘JohnRoom’ assets I want in the path ‘Resources\ThirdFloor\JohnRoom’

Can I do this and load them at runtime?

I checked the API and I didn’t see any mention of using directory structures with the Resources.Load command. Also note I did try LoadAssetAtPath, even though it even said it was just for the editor, I just wanted to try everything I could think of.

I also tried different syntaxes, such as different \ // or \ /, etc.

The last idea I just thought of, I could try making game objects to use as folders… is this what other people do?

Use

 "ThirdFloor/JohnRoom"

instead of

 "Resources\ThirdFloor\JohnRoom"

I could have sworn I tried that, but it works! :slight_smile: Thanks lehk. The coffee must have been wearing off, it was about 7:00am after I had stayed up all night.

#pragma strict

private var currentRoom : GameObject;

public function Awake(){
	currentRoom = Instantiate(Resources.Load("ThirdFloor/JohnRoom/TF_JohnRoom", GameObject));
}

Np, glad to hear it works :slight_smile: