举个例子,放在StreamingAssets中二进制文件打包后,Unity会将这些二进制文件放置在对应平台下的路径下。所以根据不同平台,访问的路径是不一样的。切记,你的二进制文件一定要放在StreamingAssets !!!!!! 1 2 3 4 5 6 7 8 9 10 #if UNITY_EDITOR stringfilepath=Application.dataPath+"/StreamingAssets"+"/my.xml"; #elif UNITY_IPHONE stringfilepath=Application.dataPath+"/Raw"+"/my.xml"; #elif UNITY_ANDROID stringfilepath="jar:file://"+Application.dataPath+"!/assets/"+"/my.xml; #endif