荣耀彩票代理

  • 热门专题

如何快速建立一个测试资源Web服务器及异步获取资源(Unity3D)

作者:伊利丹·怒风  发布日期:2016-11-28 21:01:25
  • 背景

    荣耀彩票代理1、ZUIJINKANLEJIWEIZHUANLANZUOJIADEWENZHANG,JIPIANTIDAOLEZIYUANTONGGUOWANGLUODEDONGTAIHUOQU。RUHEJIANLIYIGEKUAISUDECESHIHUANJING,BUMIANSHIYIGEWENTI,YEJIUZUIJIANDANDEJIUSHIJIASHEhttpFUWUQILE,WEIRUANXIDEDANGRANSHOUXUANDEIISLE,BIEDEYENENGYONGAPAQIHUOZHETomcatLE,netPINGTAIGENGQINGLIANGJIDEJISHUYEYOUBIRUHttpListenerHUOZHENancyDOUKEYI,SUIRANDUIYUBENRENLAISHUO,CHUANGJIANIISHUOZHEDONGSHOUXIEYIGEQINGLIANGJIDEBUSHISHENMENANSHI。DANSHIZAIwin10HUOZHEwin8SHANGZHUANGYIGEIISKUOZHANHUOZHEZIJIXIEYIGEXIAODEFUWUQIHAISHIBIJIAOFANZAO(FANZHENGWOSHIBUTAIXIHUANZAIGERENDIANNAOSHANGZHUANGFUWULEICHENGXU,NINI?),WOXIANGDAJIAYEYIDINGYOUTONGYANGDEXUANZEWENTI,ZHEILIQISHIYOUGENGJIANDANDEXUANZE。

    2、KENENGDIQIURENDOUZHIDAOUnityQISHIBUSHIHENTUIJIANSHIYONGDUOXIANCHENG,DANGRANYIBUDIAOYONGHAISHIHENYOUBIYAODE,BIRUBENWENSHUODEHUOQUIOZIYUANZHEIYANGBIJIAOHAOSHIDECAOZUO,SUOYIZUIJINYEYANJIULEYIXIEDAJIAFENXIANGDEDUOXIANCHENGDEWENZHANG,KANLEYIQUANJUEDERANGRENMANYIDEBUDUO,ZHISHIDIANJIAODUO,FENGZHUANGDEJIAOSHAO,BIJIAOCHUJI,ZHEILIPAIZHUANYINYU,JIANDANYINRUYIBANIUDAO,LIANGLIANGYAN。

    实现

    荣耀彩票代理1、ZHEILIBUMAIGUANZILE,RUHEJIANSHEYIGEJIUJIANDANDEWebFUWUQIZUOWEIWANGLUOZIYUANDECESHIFUWUQI,ZHEILIWOCAIYONGDEFANGFASHICAIYONGYIGELVSEWEIXINGDEWebFUWUQI,JIAOZUOMyWebServer,ERQIESHILVSEDEWUXUANZHUANG,JIEYAHOUSHIZHEIGEYANGZI

    1

    荣耀彩票代理ZHEILIQISHIWOMENKANDAOasp.dll ,asp.net.dll,phpDENGWENJIANQISHITABUGUANGNENGMONIJINGTAIZIYUANDEHUOQU,DONGTAIZIYUANQISHIYESHIKEYIDEBIRUJsonSHENMEDE,BUGUOBUSHIBENPIANXIANGJIANGDENEIRONG,RUGUOXIANGLEJIEZIJIKANKANCHENGXUBANGZHUWENDANGJIKE。

    荣耀彩票代理SHUANGJIMyWebServer.exeYUNXINGJIKE,HUIQIDONGZUOXIADEXIAOCHUANGKOU,ZHEILIKEYIDINGYIFUWUMULUHEGAOJISHEZHI,ZHEILIRUGUOJIUSHIBENJICESHISHIYONGJIUBUYONGDIANJIGAOJISHEZHILE,QISHIYEYONGBUZHE

    2

    WOMENJINRUwebWENJIANJIA,YEJIUSHIFUWUMULU(HUOZHEJIAOXUNIMULU,JIUSHIXIANGZAIwebFUWUQISHANGCHENLIEDEWENJIANNEIRONG)

    4

    这里我给Web目录中添加了一张图片,用来在Unity中动态获取,这里分别用图片和a.asp来测试下,在浏览器中通过本机IP进行测试如下图都成功了,至此一个绿色的版本的本地网络资源测试服务器建立完毕了,是不是很简单。

    5

    3

    2、RUHETONGGUOUnityYIBUHUODEWANGLUOTUPIANZIYUAN,ZHEILIBUSHIYONGXITONGXIECHENGLAISHIXIAN,ERSHIYONGUniRxYIBUDIAOYONGSHIXIAN

    using UnityEngine;
    荣耀彩票代理 using UniRx;

    public class BackgroundLoad : MonoBehaviour {

        // Use this for initialization
        void Start () {
            ObservableWWW.GetWWW('http://127.0.0.1/Map2.jpg').Subscribe(www =>
            {
                if (string.IsNullOrEmpty(www.error))
                {
                    Texture2D texture = www.texture;
                    SpriteRenderer render = this.GetComponent<SpriteRenderer>();
                    render.sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
                }
            });
    荣耀彩票代理     }  

    }

    荣耀彩票代理ZHEILIWOHUAIYIUnityYUANSHENGDEWWWLEIYINGGAISHIYIBUDE,ZHISHITONGGUOXIECHENGLUNXUNDEFANGSHIXIAOLVBUGAOERYI。GUANYUUniRxDEZHISHIKEYILINGXINGXUEXIHUOZHECANKAOWODEZHEIPIANWENZHANGUnityJIYUXIANGYINGSHIBIANCHENG(Reactive programming)RUMEN。

About IT165 - 广告服务 - 隐私声明 - 版权申明 - 免责条款 - 网站地图 - 网友投稿 - 联系方式
本站内容来自于互联网,仅供用于网络技术学习,学习中请遵循相关法律法规