首页 > 编程知识 正文

unity支持的图片格式,unity网络服务器

时间:2023-05-04 01:11:06 阅读:141570 作者:1035

using System.Collections; using system.collections.generic; using UnityEngine; using UnityEngine.Networking; using UnityEngine.UI; publicclassdownloadimagefromserver : mono behaviour { void start ()//异步加载start coroutine (download image ) ); } void update (ienumeratordownloadimage ) ) unity engine.net working.unitywebrequesttexture.gww yield red if (www.isnetworkerror|| www.is http error ) { debug.log } www.error }; } else { texture2dmytexture=(downloadhandlertexture ) www.downloadHandler ).texture; spritecreatesprite=sprite.create (my texture,newrect ) 0,0,myTexture.width,myTexture.height,newvector2) 0 }}具体过程类似于以下链接

用于Unity的WWW类,从服务器加载图像

另外,Unity官网上有指向这一部分的链接

从HTTP服务器获取纹理(GET )

介绍UnityWebRequest的大人物

长江后浪推前浪,UnityWebRequest代替WWW

构建本地IIS服务器并将下载的内容保存到Unity

Unity使用UnityWebRequest从服务器下载文件

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。