大家可以参考这位博主的内容 很详细http://blog..net/ynnmnm/article/details/52253674
和还有是momo雨松写的 text的创建及其读取 http://www.xuanyusong.com/archives/1069
这个也不错哦~ http://blog..net/dingxiaowei2013/article/details/19084859
//不同平台下StreamingAssets的路径是不同的,这里需要注意一下。
public static readonly string PathURL =
#if UNITY_ANDROID //安卓
"jar:file://" + Application.dataPath + "!/assets/";
#elif UNITY_IPHONE //iPhone
Application.dataPath + "/Raw/";
#elif UNITY_STANDALONE_WIN || UNITY_EDITOR //windows平台和web平台
"file://" + Application.dataPath + "/StreamingAssets/";
#else
string.Empty;
#endif
我把下载图片 跟本地保存text 与读取 写道一起了 下面是模板using UnityEngine.UI;
using UnityEngine;
using System.Collections;
using System.IO;
using System.Collections.Generic;
using System;
public class MOMO : MonoBehaviour {
public Text Input;//输入文本
public Text T; //输出文本
//文本中每行的内容
ArrayList infoall;//存放从本地的TEXT中读取的TEXT
//皮肤资源,这里用于显示中文
public GUISkin skin;//GUISkin的显示
void Start ()
{
Get_server_active_image ("0");
print("当前文件路径:"+Application.persistentDataPath);
//删除文件
DeleteFile(Application.persistentDataPath,"FileNa