使用协程调用下面的方法,传入地址信息可以得到Sprite图片
Public Sprite sprite ;
IEnumerator GetImage(string url)
{
WWW www = new WWW(url);
Debug.Log(www.ToString());
yield return www;
if (string.IsNullOrEmpty(www.error))
{
Texture2D tex = www.texture;
Sprite temp = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0, 0));
sprite = temp;
}
}