- Home /
how to access to another directory through Application.dataPath
Hi everyone, is there a way to go to another directory through Application.dataPath or would you just use normal directory path system? If you could use Application.dataPath like that I guess it would look something like this Application.dataPath/examplefolder.Is that correct?
Answer by clunk47 · Dec 31, 2012 at 06:25 AM
Application.dataPath is a string, so you will need to add another string to it like so. Here is a C# example I used to find a specific texture in my project. Be sure to add the forward slash before and after your folder location string. Also be sure to use the file extension. Notice I had to use .png for my texture file.
if(System.IO.File.Exists(Application.dataPath+"/Resources/Textures/"+"Red Slime.png"))
Debug.Log ("File Exists.");
else
Debug.Log ("No File Found.");
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Path for Assets/Textures folder File in Android 2 Answers
Can't find MonoDevelop. Unity 4.5.2 1 Answer
Launched from a browser 1 Answer