How to refer to files in specific folders during runtime?

Simple question: how can I refer to a folder both for Windows and for Android builds?
I want to refer to files in a folder that are referred only via code (no connection in the editor in any scene).

I didn’t understand how I can refer to files that are within the apk/exe. From my understanding there has to be some same structure no matter on what platform I build. If not, how can I make it work?

Unity - Scripting API: Application.dataPath didn’t really help, it doesn’t even list the Android case ô.O

I didn’t expect this to be a difficult question ô.O

I think you are talking about the Resources folder in which you set all the files and folders your project will use during runtime and yes, its platform independent…

Have a look on: Unity - Scripting API: Resources

1 Like

OK now finally I could get something to work:

foreach(object g in Resources.LoadAll("ppm")){
            // this branch is actually entered when there is a jpeg inside Assets/Resources/ppm
}

Why do I need to write object with small o?

But my problem is that the files in the ppm folder are of my own format. And when I delete my just imported jpeg file from the folder, again the then-branch is not entered. Seems Unity won’t accept my own format. If I change them to .txt files it works. But having them in a hard-coded folder also works when they have the ppm extension…