Example #1
1
 private void FadeInScreen(CanvasGroup screen)
 {
     screen.alpha = 0;
     screen.DOFade(1, 0.5f);
 }
Example #2
0
 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);
     }
 }
Example #3
0
        private void UpdateBottomPanel(bool animated, float delay, Ease easing, float bottomMargin = 0, float animDuration = 0.6f)
        {
            float botPanelYPos = 0;
            float bgYScale     = 1.05f;
            float moreBTNAlpha = botPanelState == Visibility.Fullscreen ? 0 : 1f;

            if (botPanelState == Visibility.Mini)
            {
                botPanelYPos = botPanelDefaultHeight - bottomMargin;
                bgYScale     = 1f;
            }
            else if (botPanelState == Visibility.Hidden)
            {
                botPanelYPos = -botPanelRect.sizeDelta.y;
                bgYScale     = 1f;
            }

            if (botPanelState == Visibility.Fullscreen)
            {
                setScrollRectToTop();
            }

            UnityEngine.CanvasGroup moreBTNCanvasGroup = moreButton.GetComponentInChildren <UnityEngine.CanvasGroup>();
            moreButton.interactable = botPanelState == Visibility.Mini;
            if (!animated)
            {
                Vector3 pos = botPanelRect.anchoredPosition3D;
                pos.y = botPanelYPos;
                botPanelRect.anchoredPosition3D = pos;
                whiteBGRect.localScale          = new Vector3(1f, bgYScale, 1f);
                moreBTNCanvasGroup.alpha        = moreBTNAlpha;
            }
            else
            {
                if (delay > 0)
                {
                    moreBTNCanvasGroup.DOFade(moreBTNAlpha, animDuration).SetDelay(delay);
                    botPanelRect.DOAnchorPos3DY(botPanelYPos, animDuration).SetEase(easing).SetDelay(delay);
                    whiteBGRect.DOScaleY(bgYScale, animDuration).SetEase(easing).SetDelay(delay);
                }
                else
                {
                    moreBTNCanvasGroup.DOFade(moreBTNAlpha, animDuration);
                    botPanelRect.DOAnchorPos3DY(botPanelYPos, animDuration).SetEase(easing);
                    whiteBGRect.DOScaleY(bgYScale, animDuration).SetEase(easing);
                }
            }
        }
    public void BringToForefront(CanvasGroup panel)
    {
        panel.transform.SetAsLastSibling();

        panel.DOKill();
        panel.DOFade(1.0f, this.FadeInDuration).SetEase(this.FadeEase);
    }
 protected override Tween DOPlay()
 {
     if (null == m_CanvasGroup)
     {
         return(null);
     }
     // end if
     return(m_CanvasGroup.DOFade(m_toAlpha, m_duration));
 }
Example #6
0
 static int QPYX_DOFade_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 3);
         UnityEngine.CanvasGroup QPYX_obj_YXQP = (UnityEngine.CanvasGroup)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.CanvasGroup));
         float QPYX_arg0_YXQP            = (float)LuaDLL.luaL_checknumber(L_YXQP, 2);
         float QPYX_arg1_YXQP            = (float)LuaDLL.luaL_checknumber(L_YXQP, 3);
         DG.Tweening.Tweener QPYX_o_YXQP = QPYX_obj_YXQP.DOFade(QPYX_arg0_YXQP, QPYX_arg1_YXQP);
         ToLua.PushObject(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Example #7
0
 static int DOFade(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         UnityEngine.CanvasGroup obj = (UnityEngine.CanvasGroup)ToLua.CheckObject(L, 1, typeof(UnityEngine.CanvasGroup));
         float arg0            = (float)LuaDLL.luaL_checknumber(L, 2);
         float arg1            = (float)LuaDLL.luaL_checknumber(L, 3);
         DG.Tweening.Tweener o = obj.DOFade(arg0, arg1);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #8
0
 private void FadeOutScreen(CanvasGroup screen)
 {
     screen.alpha = 1;
     screen.DOFade(0, 0.5f);
 }
Example #9
0
    /// <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 ( );
    }
Example #10
0
    /// <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 ( );
    }
Example #11
0
 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); ;
 }
 void ShowPlayingCanvas()
 {
     canvasInGame.gameObject.SetActive(true);
     canvasInGame.alpha = 0;
     canvasInGame.DOFade(1, 2.0f).OnComplete(() => LaunchPlayingRoutine()).Play();
 }