- 最后登录
- 2016-8-29
- 注册时间
- 2012-8-25
- 阅读权限
- 90
- 积分
- 23585
- 纳金币
- 20645
- 精华
- 62
|
用C#下载图片- using UnityEngine;
-
- using System.Collections;
-
- public class NewBehaviourScript : MonoBehaviour {
-
- public GameObject obj;
-
- // Use this for initialization
-
- WWW www;
-
- void Start () {
-
- StartCoroutine(ABC(“[img]http://images.earthcam.com/ec_metros/ourcams/fridays.jpg[/img]”));
-
- }
-
- // 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;
-
- }
-
- }
复制代码 |
|