您当前的位置: 首页 >  服务器

苍狼王unity学院

暂无认证

  • 4浏览

    0关注

    305博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

自己的C#框架_第8篇之加载WEB服务器端的图片

苍狼王unity学院 发布时间:2019-05-17 17:40:58 ,浏览量:4

1、开启 StartCoroutine(LoadImage(ServerAPI.serverAddress + ServerAPI.getImage + “?fileName=pic.PNG”, UIManager.Instance.GetGameObject(“CeShiImage”).GetComponent()));

2、接收 public IEnumerator LoadImage(string url, Image image) { WWW www = new WWW(url); while (!www.isDone) yield return www; Texture2D texture = www.texture; Sprite sp = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f)); image.sprite = sp; image.gameObject.SetActive(true); } 3、亲测有效。在这里插入图片描述

关注
打赏
1665389160
查看更多评论
立即登录/注册

微信扫码登录

0.1861s