Unity 3 Dプログレスバー

1314 ワード

大きなシーンでロードする場合は、現在のシーンや直接黒い画面ではなく、現在のロードのパーセントを表示する進捗バーが必要です.
 
Unity 3 Dはいくつかの関数を提供しています.
Application.LoadLevelAsync
using UnityEngine;

using System.Collections;



public class example : MonoBehaviour {

    IEnumerator Start() {

        AsyncOperation async = Application.LoadLevelAsync("MyBigLevel");

        yield return async;

        Debug.Log("Loading complete");

    }

}

 
これは非同期ロードの関数で、AsyncOperationのprogressは0-1の間の値を返し、進捗を表します.