当前位置: 首页>>代码示例>>C#>>正文


C# CanvasGroup.DOFade方法代码示例

本文整理汇总了C#中UnityEngine.CanvasGroup.DOFade方法的典型用法代码示例。如果您正苦于以下问题:C# CanvasGroup.DOFade方法的具体用法?C# CanvasGroup.DOFade怎么用?C# CanvasGroup.DOFade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.CanvasGroup的用法示例。


在下文中一共展示了CanvasGroup.DOFade方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Show

 public void Show(bool show)
 {
     mCanvasGrp = this.gameObject.GetComponent<CanvasGroup> ();
     if (show) {
         mCanvasGrp.DOFade(1,0.15f);
         mCanvasGrp.transform.DOScale(1,0.15f);
     } else {
         mCanvasGrp.DOFade(0,0.15f);
         mCanvasGrp.transform.DOScale(0,0.15f);
     }
 }
开发者ID:infusos,项目名称:rockband,代码行数:11,代码来源:PopupController.cs

示例2: BringToForefront

    public void BringToForefront(CanvasGroup panel)
    {
        panel.transform.SetAsLastSibling();

        panel.DOKill();
        panel.DOFade(1.0f, this.FadeInDuration).SetEase(this.FadeEase);
    }
开发者ID:jose-villegas,项目名称:GameJam16,代码行数:7,代码来源:MainMenuPresenter.cs

示例3: FadeOutScreen

 private void FadeOutScreen(CanvasGroup screen)
 {
     screen.alpha = 1;
     screen.DOFade(0, 0.5f);
 }
开发者ID:gcoope,项目名称:HeroesAndVillains,代码行数:5,代码来源:PlayerHUD.cs

示例4: FadeInScreen

 private void FadeInScreen(CanvasGroup screen)
 {
     screen.alpha = 0;
     screen.DOFade(1, 0.5f);
 }
开发者ID:gcoope,项目名称:HeroesAndVillains,代码行数:5,代码来源:PlayerHUD.cs

示例5: AnimateOutro

    /// <summary>
    /// Plays the outro for the menu.
    /// </summary>
    private void AnimateOutro( RectTransform sliding, CanvasGroup fading, MenuDestinations d )
    {
        //Disable input
        allowInput = false;

        //Start animation
        Sequence s = DOTween.Sequence ( )
            .Append ( fading.DOFade ( 0, FADE_TIME ) )
            .Append ( sliding.DOAnchorPos ( new Vector2 ( -sliding.rect.width, 0 ), SLIDE_TIME ) )
            .OnComplete ( () =>
            {
                //Enable input
                allowInput = true;

                //Check transistion
                switch ( d )
                {
                    case MenuDestinations.RulesToAbilites:
                        //Hide button
                        abilityButton.SetActive ( false );

                        //Hide menu panel
                        rulesPanel.gameObject.SetActive ( false );

                        //Display ability panel
                        abilitiesPanel.gameObject.SetActive ( true );

                        //Set scroll panel to the top
                        scroll.value = 1;

                        //Display first ability
                        OnAbilityClick ( abilityButtons [ 0 ], false );

                        //Play intro
                        AnimateIntro ( abilitiesPanel, fading );
                        break;
                    case MenuDestinations.AbilitiesToRules:
                        //Hide ability panel
                        abilitiesPanel.gameObject.SetActive ( false );

                        //Display menu panel
                        rulesPanel.gameObject.SetActive ( true );

                        //Display overview
                        OnMenuClick ( menuButtons [ 3 ], false );

                        //Play intro
                        AnimateIntro ( rulesPanel, fading );
                        break;
                    case MenuDestinations.Tutorial:
                        Application.LoadLevel ( "Game Board" );
                        break;
                    case MenuDestinations.None:
                        Application.LoadLevel ( "Main Menu" );
                        break;
                }
            } )
            .SetRecyclable ( )
            .Play ( );
    }
开发者ID:ethancaraway,项目名称:Evasion,代码行数:63,代码来源:RulesMenu.cs

示例6: AnimateIntro

    /// <summary>
    /// Plays the intro animation for the menu.
    /// </summary>
    private void AnimateIntro( RectTransform sliding, CanvasGroup fading )
    {
        //Disable input
        allowInput = false;

        //Set starting values
        sliding.anchoredPosition = new Vector2 ( -sliding.rect.width, 0 );
        fading.alpha = 0;

        //Start animation
        Sequence s = DOTween.Sequence ( )
            .Append ( sliding.DOAnchorPos ( Vector2.zero, SLIDE_TIME ) )
            .Append ( fading.DOFade ( 1, FADE_TIME ) )
            .OnComplete ( () =>
            {
                //Enable input
                allowInput = true;
            } )
            .SetRecyclable ( )
            .Play ( );
    }
开发者ID:ethancaraway,项目名称:Evasion,代码行数:24,代码来源:RulesMenu.cs

示例7: FadeEndLevelCanvas

 IEnumerator FadeEndLevelCanvas(CanvasGroup canvasToFade)
 {
     yield return new WaitForSeconds(1.0f);
     canvasToFade.DOFade(1.0f, 1.5f).SetEase(Ease.OutCubic);
     yield return new WaitForSeconds(2f);
     canvasToFade.DOFade(0f, 2.5f).SetEase(Ease.InCubic); ;
 }
开发者ID:sprawls,项目名称:LudumDare33,代码行数:7,代码来源:GameManager.cs


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