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. }

你可能感兴趣的:(unity记事本)