本文整理汇总了C#中AsyncOperation类的典型用法代码示例。如果您正苦于以下问题:C# AsyncOperation类的具体用法?C# AsyncOperation怎么用?C# AsyncOperation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AsyncOperation类属于命名空间,在下文中一共展示了AsyncOperation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: show
public void show(AsyncOperation ao)
{
Debug.Log("ao.progress: " + ao.progress);
gameObject.SetActive(true);
bg.SetActive(true);
progressBar.value = ao.progress;
}
示例2: Show
public void Show(AsyncOperation ao)
{
BG.SetActive(true);
isAsyn = true;
this.ao = ao;
}
示例3: Load
IEnumerator Load()
{
try
{
stageName = sc.getStageName().ToString();
print("stageName: " + stageName);
// 非同期でロード開始
async = Application.LoadLevelAsync(stageName.ToString());
// デフォルトはtrue。ロード完了したら勝手にシーンきりかえ発生しないよう設定。
async.allowSceneActivation = false;
}
catch (Exception)
{
Application.LoadLevelAsync("StageSelect");
yield break;
}
// 非同期読み込み中の処理
while (async.progress < 0.9f)
{
loadingText.text = "NowLoading..." + (async.progress * 100).ToString("F0") + "%";
//Debug.Log("ローディングパーセント" + async.progress * 100);
lodingBar.value = async.progress;
yield return new WaitForEndOfFrame();
}
lodingBar.value = 0.9f;
loadingText.text = "NowLoading...100%";
state.setState(GameState.NotPlaying);
yield return async;
}
示例4: loadScene
IEnumerator loadScene()
{
async = Application.LoadLevelAsync (Globe.getInstance().loadName);
async.allowSceneActivation = false;
while(async.progress<0.9f)
{
per+=0.01f;
text.text =Mathf.Floor( per*100)+"%";
loadingMc.fillAmount = per;
yield return new WaitForEndOfFrame();
}
while (per <1f)
{
per+=0.01f;
text.text =Mathf.Floor( per*100)+"%";
loadingMc.fillAmount = per;
yield return new WaitForEndOfFrame();
}
if(Globe.getInstance().afterEnterWorldHandler!=null)
{
Globe.getInstance().afterEnterWorldHandler();
Globe.getInstance().afterEnterWorldHandler=null;
}
async.allowSceneActivation = true;
}
示例5: LoadALevel
private IEnumerator LoadALevel(string sceneName)
{
yield return new WaitForSeconds(5f);
async = SceneManager.LoadSceneAsync(sceneName);
//yield return new WaitForSeconds(6f);
yield return async;
}
示例6: Start
IEnumerator Start()
{
// 非同期でロード開始
switch(ButtonC.courceNum){
case 1:
async0 = Application.LoadLevelAsync("Stage00");
async0.allowSceneActivation= false;
yield return async0;
break;
case 2:
async0 = Application.LoadLevelAsync("Stage01");
async0.allowSceneActivation= false;
yield return async0;
break;
case 3:
async0 = Application.LoadLevelAsync("Stage10");
async0.allowSceneActivation= false;
yield return async0;
break;
default:
break;
}
}
示例7: loadScene
IEnumerator loadScene()
{
isAsync = true;
async = Application.LoadLevelAsync(Global.GetInstance().loadName);
async.allowSceneActivation = false;//禁止协程加载完自动跳转关卡
yield return async;
}
示例8: Start
void Start()
{
async = Application.LoadLevelAsync(5);
async.allowSceneActivation = false;
//yield return async;
Debug.Log("Loading complete");
}
示例9: StreamLevel
void StreamLevel()
{
if (nextLevelID >= 0) {
level = Application.LoadLevelAdditiveAsync(nextLevelID);
level.allowSceneActivation = false;
}
}
示例10: changeScene
public void changeScene(string nextScene)
{
//Application.LoadLevel(nextScene);
preloaderScreen.SetActive (true);
loadOp = Application.LoadLevelAsync(nextScene);
StartCoroutine (ScenePreload ());
}
示例11: Start
public void Start()
{
if (this.SyncRequest == null)
{
this.SyncRequest = Res.LoadAsync(this.resourcePath, this.resourceType);
}
}
示例12: AsyncLoadLevel
copyrightVisible = false; //determines if copyright is visible
#endregion Fields
#region Methods
//Loads the next scene.
IEnumerator AsyncLoadLevel()
{
async = Application.LoadLevelAsync("Greenlight Screen");
async.allowSceneActivation = false;
yield return async;
Debug.Log("Loading complete");
}
示例13: load
IEnumerator load() {
Debug.LogWarning("ASYNC LOAD STARTED - " +
"DO NOT EXIT PLAY MODE UNTIL SCENE LOADS... UNITY WILL CRASH");
async = Application.LoadLevelAsync(sceneToLoad.ToString());
async.allowSceneActivation = false;
yield return async;
}
示例14: LoadScene
IEnumerator LoadScene()
{
processBar.gameObject.SetActive(true);
async = Application.LoadLevelAsync("Main");
async.allowSceneActivation = false;
yield return async;
}
示例15: Workflow
IEnumerator Workflow()
{
FadeIn fadeIn = logo.AddComponent<FadeIn>();
fadeIn.time = 1.0f;
fadeIn.Begin();
yield return new WaitForSeconds(2f);
FadeOut fadeOut = logo.AddComponent<FadeOut>();
fadeOut.time = 1.0f;
fadeOut.Begin();
yield return new WaitForSeconds(1f);
logo.SetActive(false);
loadingLayer.SetActive(true);
yield return new WaitForEndOfFrame();
MoveBy move = title.AddComponent<MoveBy>();
move.offset = new Vector3(0, -2f, 0);
move.time = 1f;
move.Begin();
yield return new WaitForSeconds(1f);
async = Application.LoadLevelAsync("MainScene");
async.allowSceneActivation = false;
yield return StartCoroutine(Loading());
text.text = "开始游戏";
button.enabled = true;
}