Application.temporaryCachePath==/storage/emulated/0/Android/data/com.***.***/cache
Application.persistentDataPath==/storage/emulated/0/Android/data/com.***.***/files
或許你碰到過,在電腦讀取該目錄下的文件一點問題也沒有,突然發不到Android怎么也讀取不到。是吧即便路徑改成Android上的路徑也讀取不到 "jar:file://" + Application.dataPath + "!/assets";
嗯嗯嗯,Android上就是這么特殊,其實不是文件路徑不對,而是在Android上讀取文件的方式不對哎
他需要以WWW的方式去讀。好坑啊
path=Application.streamingAssetsPath+“文件名。后綴”
string str;
IEnumerator ReadFile(string path)
{
WWW www = new WWW(path);
yield return www;
if (string.IsNullOrEmpty(www.error))
{
str= www.text;
}
}