当前位置:   article > 正文

unity异步加载场景获取进度实例[笔记]_unity根据接口获取进度条

unity根据接口获取进度条
  1. using UnityEngine;
  2. using System.Collections;
  3. public class StartScreenGUI : MonoBehaviour {
  4. private AsyncOperation asyncOpe;
  5. void Start(){
  6. asyncOpe = Application.LoadLevelAsync( "Play" );
  7. asyncOpe.allowSceneActivation = false; //是否允许场景激活
  8. }
  9. void Update(){
  10. if( asyncOpe.isDone == true ){
  11. Debug.Log("Loaded");
  12. }else{
  13. Debug.Log(" progress = " +asyncOpe.progress);
  14. }
  15. }
  16. }
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/125275?site
推荐阅读
相关标签
  

闽ICP备14008679号