Пример #1
0
        public void ShowJinGongBtn(bool show)
        {
            if (_jinGongTweener != null)
            {
                _jinGongTweener.Kill();
                _jinGongTweener = null;
            }

            if (show)
            {
                _soundController.PlayPleaseChuPaiSound();
                CardLayout.SelectJinGongPoker();

                if (!JinGongBtnTransform.gameObject.activeSelf)
                {
                    JinGongBtnTransform.gameObject.SetActive(true);
                }

                JinGongBtnTransform.localScale = new Vector3(0, 0, 1);
                _jinGongTweener = JinGongBtnTransform
                                  .DOScale(new Vector3(1, 1, 1), ShowAnimationTime)
                                  .SetEase(Ease.OutBack, 1.1f);
            }
            else
            {
                if (JinGongBtnTransform.gameObject.activeSelf)
                {
                    _jinGongTweener = JinGongBtnTransform
                                      .DOScale(new Vector3(0, 0, 1), HideAnimationTime)
                                      .SetEase(Ease.Linear)
                                      .OnComplete(() => JinGongBtnTransform.gameObject.SetActive(false));
                }
            }
        }
Пример #2
0
        public void ShowChuPaiGroup(bool show, bool withBuChu = true)
        {
            if (_chuPaiGroupTweener != null)
            {
                _chuPaiGroupTweener.Kill();
                _chuPaiGroupTweener = null;
            }

            if (_buChuGroupTweener != null)
            {
                _buChuGroupTweener.Kill();
                _buChuGroupTweener = null;
            }

            if (ChuPaiGroupTransform)
            {
                if (show)
                {
                    _soundController.PlayPleaseChuPaiSound();

                    if (!ChuPaiGroupTransform.gameObject.activeSelf)
                    {
                        ChuPaiGroupTransform.gameObject.SetActive(true);
                    }

                    ChuPaiGroupTransform.localScale = new Vector3(0, 0, 1);

                    _chuPaiGroupTweener = ChuPaiGroupTransform
                                          .DOScale(new Vector3(1, 1, 1), ChuPaiGroupShowAnimationTime)
                                          .SetEase(Ease.OutBack, 1.1f);
                }
                else
                {
                    if (ChuPaiGroupTransform.gameObject.activeSelf)
                    {
                        _chuPaiGroupTweener = ChuPaiGroupTransform
                                              .DOScale(new Vector3(0, 0, 1), ChuPaiGroupHideAnimationTime)
                                              .SetEase(Ease.Linear)
                                              .OnComplete(() => ChuPaiGroupTransform.gameObject.SetActive(false));
                    }
                }
            }

            if (!show)
            {
                withBuChu = false;
            }

            if (BuChuGroupTransform)
            {
                if (withBuChu)
                {
                    if (!BuChuGroupTransform.gameObject.activeSelf)
                    {
                        BuChuGroupTransform.gameObject.SetActive(true);
                    }

                    BuChuGroupTransform.localScale = new Vector3(0, 0, 1);
                    _buChuGroupTweener             = BuChuGroupTransform
                                                     .DOScale(new Vector3(1, 1, 1), ChuPaiGroupShowAnimationTime)
                                                     .SetEase(Ease.OutBack, 1.1f);
                }
                else
                {
                    if (BuChuGroupTransform.gameObject.activeSelf)
                    {
                        _buChuGroupTweener = BuChuGroupTransform
                                             .DOScale(new Vector3(0, 0, 1), ChuPaiGroupHideAnimationTime)
                                             .SetEase(Ease.Linear)
                                             .OnComplete(() => BuChuGroupTransform.gameObject.SetActive(false));
                    }
                }
            }
        }