Accessing filepath to an image file

Hi, I really need help with this one

I have an image file. I want to place that image file somewhere on the project, and I want be able to get this image file path on runtime, on the iOS device. The image will not be placed on the folder on runtime, it will already be there. I can do it manually before building.

I have read about Application.persistentDataPath, but I am not sure how to use that on the project. I would really appreciate some help.

Thank you for your attention.

You can copy a file to your device’s Documents folder (persistent data path) with an OSX app such as iExplorer or iFunBox.

To access via Unity

string fileName = "test";
string path = Application.persistentDataPath + "/" + fileName;
// Then read it, e.g. System.Text.File.ReadAllText

Really appreciate your answer, andymads… the deal is that ahving to run another app in order to get an image there is surely not a viable option for me.

Maybe someone else could have an answer for that?

Thanks a lot, though :slight_smile:

Streaming assets?

To place an image file on the project, you just need to load the image from local file with correct path. But in most cases, you may install an image processing control in the project so that you can load the image.