當前位置: 首頁>>代碼示例>>C#>>正文


C# AsyncOperation類代碼示例

本文整理匯總了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;
	}
開發者ID:xiaopan1991,項目名稱:TaidouARPGProject,代碼行數:7,代碼來源:LoadSceneProgressBar.cs

示例2: Show

    public void Show(AsyncOperation ao)
    {

        BG.SetActive(true);
        isAsyn = true;
        this.ao = ao;
    }
開發者ID:tsss-t,項目名稱:SimpleStory,代碼行數:7,代碼來源:UISceneManager.cs

示例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;
    }
開發者ID:saihe,項目名稱:July_Unity_TeamMJ,代碼行數:30,代碼來源:LoadScene.cs

示例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;
    }
開發者ID:qxhusunren,項目名稱:test_ui1,代碼行數:27,代碼來源:LoadingBar.cs

示例5: LoadALevel

 private IEnumerator LoadALevel(string sceneName)
 {
     yield return new WaitForSeconds(5f);
     async = SceneManager.LoadSceneAsync(sceneName);
     //yield return new WaitForSeconds(6f);
     yield return async;
 }
開發者ID:SMBNoog,項目名稱:IsleOfAdventure,代碼行數:7,代碼來源:SceneLoader.cs

示例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;
        }
    }
開發者ID:TakaakiJimbo,項目名稱:Race,代碼行數:26,代碼來源:Ready.cs

示例7: loadScene

	IEnumerator loadScene()  
	{  
		isAsync = true;
		async = Application.LoadLevelAsync(Global.GetInstance().loadName);
		async.allowSceneActivation = false;//禁止協程加載完自動跳轉關卡
		yield return async;
	}
開發者ID:totoro-j,項目名稱:BallSpy,代碼行數:7,代碼來源:LoadingScene.cs

示例8: Start

 void Start()
 {
     async = Application.LoadLevelAsync(5);
     async.allowSceneActivation = false;
     //yield return async;
     Debug.Log("Loading complete");
 }
開發者ID:Kilmainham,項目名稱:Kilmainham,代碼行數:7,代碼來源:AsyncTesting.cs

示例9: StreamLevel

 void StreamLevel()
 {
     if (nextLevelID >= 0) {
         level = Application.LoadLevelAdditiveAsync(nextLevelID);
         level.allowSceneActivation = false;
     }
 }
開發者ID:ZPZ-Gr2,項目名稱:AwesomeGameInSpace,代碼行數:7,代碼來源:IrisButton.cs

示例10: changeScene

 public void changeScene(string nextScene)
 {
     //Application.LoadLevel(nextScene);
     preloaderScreen.SetActive (true);
     loadOp = Application.LoadLevelAsync(nextScene);
     StartCoroutine (ScenePreload ());
 }
開發者ID:rdenubila,項目名稱:Uberland,代碼行數:7,代碼來源:MenuController.cs

示例11: Start

 public void Start()
 {
     if (this.SyncRequest == null)
     {
         this.SyncRequest = Res.LoadAsync(this.resourcePath, this.resourceType);
     }
 }
開發者ID:floatyears,項目名稱:Decrypt,代碼行數:7,代碼來源:ResourceEntity.cs

示例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");
    }
開發者ID:redahanb,項目名稱:Spectral,代碼行數:14,代碼來源:MotorTreeLogo.cs

示例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;
	}
開發者ID:dearzhangle,項目名稱:UNION-OpenSource-MOBA,代碼行數:7,代碼來源:SceneLoader.cs

示例14: LoadScene

 IEnumerator LoadScene()
 {
     processBar.gameObject.SetActive(true);
     async = Application.LoadLevelAsync("Main");
     async.allowSceneActivation = false;
     yield return async;
 }
開發者ID:qq282196521,項目名稱:DK,代碼行數:7,代碼來源:StartScene.cs

示例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;
    }
開發者ID:xuyjun,項目名稱:PlantsVsZombies_unity,代碼行數:29,代碼來源:LoadScene.cs


注:本文中的AsyncOperation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。