用C#下载图片
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
public GameObject obj;
// Use this for initialization
WWW www;
void Start () {
StartCoroutine(ABC("http://images.earthcam.com/ec_metros/ourcams/fridays.jpg"));
}
// Update is called once per frame
void Update ()
{
if(www.isDone)
{
renderer.material.mainTexture = www.texture;
www=null;
}
else
{
print(www);
}
}
public IEnumerator ABC(string URL)
{
www = new WWW (URL);
yield return www;
}
}