首页 > 编程语言 > 详细

unity WWW加载进度条

时间:2017-03-01 10:51:45      阅读:466      评论:0      收藏:0      [点我收藏+]
using UnityEngine;
using System.Collections;

public class testProgress : MonoBehaviour {

   void Start () { StartCoroutine (getWWW()); } IEnumerator getWWW(){ WWW www = new WWW ("http://192.168.1.106/app/s01.mp3"); string progress; while(!www.isDone){ progress=(((int)(www.progress * 100)) % 100) + "%"; Debug.Log (progress); yield return 1; } if(www.error!=null){ Debug.Log ("loading error:"+www.url); }else{ progress="100%"; Debug.Log (progress); //enter complete code } } }

 

unity WWW加载进度条

原文:http://www.cnblogs.com/kingBook/p/6482964.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!