void Start ()
{
streampath = Application.persistentDataPath + "/" + transform.name + ".jpg";
///Application.persistentDataPath是安卓可读可写路径,/storage/emulate/0/Android/data/com.xxx.xxx/file/下///
StartCoroutine(Getbye());
///StartCoroutine打开协程///
}
private IEnumerator Getbye()
{
WWW www = new WWW("file:///"+streampath);
/// 安卓深坑,安卓下要加file:///不然无法访问!!!!!!///
yield return www;
Texture2D texture2D = new Texture2D(450, 300);
if(www.isDone)
{
texture2D.LoadImage(www.bytes);
GetComponent<RawImage>().texture = texture2D;
}
}