• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# AsyncOperation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AsyncOperation的典型用法代码示例。如果您正苦于以下问题:C# AsyncOperation类的具体用法?C# AsyncOperation怎么用?C# AsyncOperation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AsyncOperation类属于命名空间,在下文中一共展示了AsyncOperation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: ContinueWithActionInterfaceToOperationCallbackTest

        public void ContinueWithActionInterfaceToOperationCallbackTest()
        {
            var operation = new AsyncOperation<bool>();
            IOperationResult<bool> operationResult = OperationResult.CreateResult(OperationType.PageNavigation, this, true,
                DataContext.Empty);

            bool isInvoked = false;
            var continuationAction = new ActionContinuationMock
            {
                Invoke = result =>
                {
                    result.ShouldEqual(operationResult);
                    isInvoked = true;
                }
            };

            operation.ContinueWith(continuationAction);
            isInvoked.ShouldBeFalse();
            operation.ToOperationCallback().Invoke(operationResult);
            isInvoked.ShouldBeTrue();

            isInvoked = false;
            operation.ContinueWith(continuationAction);
            isInvoked.ShouldBeTrue();
        }
开发者ID:sami1971,项目名称:MugenMvvmToolkit,代码行数:25,代码来源:AsyncOperationTest.cs


示例4: Show

 public void Show(AsyncOperation ao)
 {
     gameObject.SetActive(true);
     bg.SetActive(true);
     isAsyn = true;
     this.ao = ao;
 }
开发者ID:1510649869,项目名称:ARPG_project,代码行数:7,代码来源:LoadSceneProgressBar.cs


示例5: OperationShouldSerializeAsyncMethodWithViewModel

        public void OperationShouldSerializeAsyncMethodWithViewModel()
        {
            var vmMock = new NavigableViewModelMock();
            ServiceProvider.OperationCallbackFactory = new SerializableOperationCallbackFactory();
            var operation = new AsyncOperation<bool>();
            IOperationResult<bool> result = OperationResult.CreateResult(OperationType.PageNavigation, this, true,
                new NavigationContext(NavigationType.Page, NavigationMode.Back, vmMock, vmMock, this));

            AsyncMethodWithViewModel(operation, true, vmMock);
            var callback = operation.ToOperationCallback();
            var serialize = Serializer.Serialize(callback);
            serialize.Position = 0;
            callback = (IOperationCallback)Serializer.Deserialize(serialize);

            IocContainer.GetFunc = (type, s, arg3) =>
            {
                if (type == GetType())
                    return this;
                return Activator.CreateInstance(type);
            };
            AsyncMethodInvoked.ShouldBeFalse();
            ViewModel.ShouldBeNull();
            callback.Invoke(result);
            AsyncMethodInvoked.ShouldBeTrue();
            ViewModel.ShouldEqual(vmMock);
        }
开发者ID:MuffPotter,项目名称:MugenMvvmToolkit,代码行数:26,代码来源:SerializableAsyncOperationTest.cs


示例6: 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


示例7: 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


示例8: 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


示例9: 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


示例10: loadScene

	IEnumerator loadScene()  
	{  
		isAsync = true;
		async = Application.LoadLevelAsync(Global.GetInstance().loadName);
		async.allowSceneActivation = false;//禁止协程加载完自动跳转关卡
		yield return async;
	}
开发者ID:totoro-j,项目名称:BallSpy,代码行数:7,代码来源:LoadingScene.cs


示例11: Start

 void Start()
 {
     async = Application.LoadLevelAsync(5);
     async.allowSceneActivation = false;
     //yield return async;
     Debug.Log("Loading complete");
 }
开发者ID:Kilmainham,项目名称:Kilmainham,代码行数:7,代码来源:AsyncTesting.cs


示例12: StreamLevel

 void StreamLevel()
 {
     if (nextLevelID >= 0) {
         level = Application.LoadLevelAdditiveAsync(nextLevelID);
         level.allowSceneActivation = false;
     }
 }
开发者ID:ZPZ-Gr2,项目名称:AwesomeGameInSpace,代码行数:7,代码来源:IrisButton.cs


示例13: changeScene

 public void changeScene(string nextScene)
 {
     //Application.LoadLevel(nextScene);
     preloaderScreen.SetActive (true);
     loadOp = Application.LoadLevelAsync(nextScene);
     StartCoroutine (ScenePreload ());
 }
开发者ID:rdenubila,项目名称:Uberland,代码行数:7,代码来源:MenuController.cs


示例14: Start

 public void Start()
 {
     if (this.SyncRequest == null)
     {
         this.SyncRequest = Res.LoadAsync(this.resourcePath, this.resourceType);
     }
 }
开发者ID:floatyears,项目名称:Decrypt,代码行数:7,代码来源:ResourceEntity.cs


示例15: 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


示例16: 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


示例17: LoadScene

 IEnumerator LoadScene()
 {
     processBar.gameObject.SetActive(true);
     async = Application.LoadLevelAsync("Main");
     async.allowSceneActivation = false;
     yield return async;
 }
开发者ID:qq282196521,项目名称:DK,代码行数:7,代码来源:StartScene.cs


示例18: 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


示例19: LoadLevel

    private IEnumerator LoadLevel(int iSceneIndex)
    {
        m_LabelProg.gameObject.SetActive(true);

        m_Asyn = SceneManager.LoadSceneAsync (iSceneIndex);
        yield return m_Asyn;
    }
开发者ID:yabos,项目名称:BattleHit,代码行数:7,代码来源:Title_Control.cs


示例20: LoadNextLevel

	IEnumerator LoadNextLevel()
	{
		async = Application.LoadLevelAsync(1);
		async.allowSceneActivation = false;

		yield return async;
	}
开发者ID:nimdanet,项目名称:CreepyBuster,代码行数:7,代码来源:SplashController.cs



注:本文中的AsyncOperation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AsyncProtocolRequest类代码示例发布时间:2022-05-24
下一篇:
C# AsyncObservableCollection类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap