當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。