Unity3D
中文本文件的读写
Unity3D
中文本文件的读写
。Application.dataPath
是当前的工作目录。在工作目录创建文件,写入内容,并读写。任务及其相关需要读入数据的系统基本能完成了,包括存盘。
import System.IO;
function Start()
{var sw : StreamWriter = new StreamWriter(Application.dataPath + "/wtf.txt");
sw.WriteLine("hello talk");
sw.Flush();
sw.Close();
var sr = new File.OpenText(Application.dataPath + "/wtf.txt");
Debug.Log(sr.ReadLine());
sr.Close();
}


雷达卡




京公网安备 11010802022788号







