unity 读取个平台文件路径

来源:互联网 发布:办户外婚礼多少钱知乎 编辑:程序博客网 时间:2024/05/01 17:42
 

将文件打包进StreamingAssets,然后用下面路径读取


#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
0 0