- 最后登录
- 2017-5-15
- 注册时间
- 2012-3-1
- 阅读权限
- 90
- 积分
- 32973
- 纳金币
- 32806
- 精华
- 12
|
public string loadText() {
string path = Application.dataPath + "/texts/game.txt";
//string path = Application.persistentDataPath + "/texts/game.txt";
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(fs);
string str = sr.ReadToEnd();
sr.Close();
fs.Close();
return str;
}
在电脑上正确,iPhone上放到Data文件夹后也正确了。不过android手机应该把game.txt文本放哪才能在android手机上显示呢?请教
|
|