现在的位置: 首页 > 综合 > 正文

Unity3d 通过网页下载资源

2014年08月29日 ⁄ 综合 ⁄ 共 576字 ⁄ 字号 评论关闭
function Start () {
    // The sql statement translate to webpage to return a record
	var sql_text:String = "select * from equipment,image where self_name = '" + self_name + "' and equipment.modelid=image.modelid and used = 1";
    //Call webPage
    Application.ExternalCall("ProcessDeviceSQL",sql_text,self_name);
}

//Accept the device description
function ReceiveParam(param:String){
	var temp = param.Split('@'[0]);//将传过来的参数以@字符分割成数组
	content_text = System.Text.RegularExpressions.Regex.Unescape(temp[0].ToString());
	StartCoroutine(DownPic(temp[1].ToString()));
}

function DownPic(url){
    var www:WWW = new WWW(url);
	yield www;
	content_pic = www.texture;
}

抱歉!评论已关闭.