Exemple #1
0
 private void DoFadeAndMove(MaskableGraphic trans, float fadeTime, float moveTime, Vector3 moveTarget, Action onFinished)
 {
     DoTweenHelper.DoFade(trans, 1, fadeTime, Ease.Flash, null);
     DoTweenHelper.DoLocalMove(trans.transform, moveTarget, moveTime, Ease.Flash, () =>
     {
         if (onFinished != null)
         {
             onFinished();
         }
     });
 }
Exemple #2
0
    public override void InitData(object[] args)
    {
        base.InitData(args);

        _circle.transform.localScale           = Vector3.zero;
        _jiayu.transform.localPosition         = new Vector3(116f, 80f, 0f);
        _entertainment.transform.localPosition = new Vector3(26f, -25f, 0f);
        InitColor(_jiayu);
        InitColor(_entertainment);
        InitColor(_fangkuai);
        InitColor(_meihua);
        InitColor(_hongtao);
        InitColor(_heitao);

        DoTweenHelper.DoScale(_circle.transform, Vector3.one, 0.7f, Ease.Flash, null);
        var splashRotation = _circle.GetComponent <SplashRotation>();

        splashRotation.RotateTime = 0.7f;
        splashRotation.StartRotate();

        //0.2+0.2+0.1+0.1+0.1+0.1 = 0.8f
        DoFadeAndMove(_jiayu, 0.2f, 0.2f, new Vector3(116f, 36f, 0f), () =>
        {
            DoFadeAndMove(_entertainment, 0.2f, 0.2f, new Vector3(26f, -55f, 0f), () =>
            {
                Sequence seq = DOTween.Sequence();
                seq.Append(DoTweenHelper.DoFade(_fangkuai, 1, 0.1f, Ease.Flash, null))
                .Append(DoTweenHelper.DoFade(_meihua, 1, 0.1f, Ease.Flash, null))
                .Append(DoTweenHelper.DoFade(_hongtao, 1, 0.1f, Ease.Flash, null))
                .Append(DoTweenHelper.DoFade(_heitao, 1, 0.1f, Ease.Flash, () =>
                {
                    //StartCoroutine(DelayEnterGame(1f));
                    EnterGame();
                }));
            });
        });

        AudioManager.instance.PlayAudio(EAndioType.Bg, "bg_hall");
    }
    IEnumerator MoveTips()
    {
        if (_tipsQueue.Count <= 0)
        {
            base.Close();
            yield break;
        }

        TipsInfo tipsInfo = _tipsQueue.Dequeue();

        _tips.text = tipsInfo.Tips;
        yield return(new WaitForFixedUpdate());

        //_tips框移动的最终距离
        float endValueX = _tips.transform.localPosition.x - (_tips.GetComponent <RectTransform>().sizeDelta.x + _maskTransformLength);
        //_tips框移动的时间
        float duration = Mathf.Abs(endValueX / _maskTransformLength * _timer);

        DoTweenHelper.DoLocalMoveX(_tips.transform, endValueX, duration, Ease.Flash, () =>
        {
            ResetTipsInfo();
            _moveCoroutine = StartCoroutine(MoveTips());
        }).SetLoops(tipsInfo.LoopTimes, LoopType.Restart);
    }
Exemple #4
0
    /// <summary>
    /// 执行翻页动画
    /// </summary>
    /// <param name="clickKey"></param>
    private void DoPageTransMove(E_ClickKey clickKey)
    {
        //加载新界面数据
        LoadNewPageData(clickKey);

        Transform currentPageItem  = GetTheOtherPageTrans(_currentPageData.Trans);
        Transform theOtherPageItem = _currentPageData.Trans;

        Vector3 theOtherStartPos  = default(Vector3);
        Vector3 theOtherTargetPos = CenterPosition;

        Vector3 curStartPos  = CenterPosition;
        Vector3 curTargetPos = default(Vector3);

        Vector2 pageSize = PageTrans.GetComponent <RectTransform>().sizeDelta;

        switch (clickKey)
        {
        case E_ClickKey.Up:
            theOtherStartPos = new Vector3(0f, pageSize.y);
            curTargetPos     = new Vector3(0f, -pageSize.y);
            break;

        case E_ClickKey.Down:
            theOtherStartPos = new Vector3(0f, -pageSize.y);
            curTargetPos     = new Vector3(0f, pageSize.y);
            break;

        case E_ClickKey.Left:
            theOtherStartPos = new Vector3(-pageSize.x, 0f);
            curTargetPos     = new Vector3(pageSize.x, 0f);
            break;

        case E_ClickKey.Right:
            theOtherStartPos = new Vector3(pageSize.x, 0f);
            curTargetPos     = new Vector3(-pageSize.x, 0f);
            break;
        }

        currentPageItem.localPosition  = curStartPos;
        theOtherPageItem.localPosition = theOtherStartPos;

        _isMoving = true;
        if (HandleMove != null)
        {
            HandleMove();
        }
        EnablePageItemBtn(currentPageItem, false);
        //        Debug.Log(currentPageItem.localPosition + "  " + curTargetPos);
        //        Debug.Log(theOtherPageItem.localPosition + "  " + theOtherTargetPos);
        DoTweenHelper.DoLocalMove(currentPageItem, curTargetPos, 0.5f, EaseType, () =>
        {
            EnablePageItemBtn(currentPageItem, true);
        });
        DoTweenHelper.DoLocalMove(theOtherPageItem, theOtherTargetPos, 0.5f, EaseType, () =>
        {
            _isMoving = false;
            if (HandleMoveComplete != null)
            {
                HandleMoveComplete();
            }
            if (clickKey == E_ClickKey.Up || clickKey == E_ClickKey.Left)
            {
                for (int i = theOtherPageItem.childCount - 1; i >= 0; i--)
                {
                    var item = theOtherPageItem.GetChild(i).gameObject;
                    if (item.activeSelf)
                    {
                        UIController.instance.CurrentSelectedObj = item;
                        break;
                    }
                }
            }
            else if (clickKey == E_ClickKey.Down || clickKey == E_ClickKey.Right)
            {
                UIController.instance.CurrentSelectedObj = theOtherPageItem.GetChild(0).gameObject;
            }
        });
    }
    public override void InitData(object[] args)
    {
        base.InitData(args);

        DoTweenHelper.DoScale(_popWindow.transform, Vector3.one, 0.5f, Ease.OutBack, null);
    }