public void Show(UnoGamePlayData.BackgroundColor _bgColor)
    {
        if (currentState == State.Show)
        {
            return;
        }
        LeanTween.cancel(gameObject);

        currentState         = State.Show;
        myCanvasGroup.alpha  = 0f;
        transform.localScale = Vector3.one * 0.5f;

        switch (_bgColor)
        {
        case UnoGamePlayData.BackgroundColor.Red:
            imgIcon.color = colorIconRed;
            break;

        case UnoGamePlayData.BackgroundColor.Green:
            imgIcon.color = colorIconGreen;
            break;

        case UnoGamePlayData.BackgroundColor.Blue:
            imgIcon.color = colorIconBlue;
            break;

        case UnoGamePlayData.BackgroundColor.Yellow:
            imgIcon.color = colorIconYellow;
            break;
        }

        LeanTween.alphaCanvas(myCanvasGroup, 1f, timeShowEffect);
        LeanTween.scale(gameObject, Vector3.one, timeShowEffect).setEase(LeanTweenType.easeOutBack);
    }
Beispiel #2
0
    public IEnumerator DoActionSetColor(UnoGamePlayData.BackgroundColor _bgColor, bool _updateNow = true)
    {
        Color _c = colorBgYellow;

        switch (_bgColor)
        {
        case UnoGamePlayData.BackgroundColor.Red:
            _c = colorBgRed;
            break;

        case UnoGamePlayData.BackgroundColor.Green:
            _c = colorBgGreen;
            break;

        case UnoGamePlayData.BackgroundColor.Blue:
            _c = colorBgBlue;
            break;

        case UnoGamePlayData.BackgroundColor.Yellow:
            _c = colorBgYellow;
            break;
        }
        if (myState == State.Hide)
        {
            _c.a = 0f;
        }
        else
        {
            _c.a = alphaWhenActive;
        }
        if (_updateNow)
        {
            mySprite.color = _c;
            yield break;
        }
        else
        {
            bool _isFinished = false;
            LeanTween.color(mySprite.gameObject, _c, tweenTime).setOnComplete(() => {
                _isFinished = true;
            });
            yield return(new WaitUntil(() => _isFinished));
        }
    }
    public IEnumerator DoActionSetColor(UnoGamePlayData.BackgroundColor _bgColor, bool _updateNow = true)
    {
        Color _c = colorBgGlow_Yellow;

        switch (_bgColor)
        {
        case UnoGamePlayData.BackgroundColor.Red:
            _c = colorBgGlow_Red;
            break;

        case UnoGamePlayData.BackgroundColor.Green:
            _c = colorBgGlow_Green;
            break;

        case UnoGamePlayData.BackgroundColor.Blue:
            _c = colorBgGlow_Blue;
            break;

        case UnoGamePlayData.BackgroundColor.Yellow:
            _c = colorBgGlow_Yellow;
            break;
        }
        if (_updateNow)
        {
            imgGlow_00.color = _c;

            Color _c1 = imgGlow_01.color;
            _c1.a            = 1f;
            imgGlow_01.color = _c1;
            yield break;
        }
        else
        {
            bool _isFinished = false;
            LeanTween.color(imgGlow_00.rectTransform, _c, tweenColorTime).setOnComplete(() => {
                _isFinished = true;
            });
            LeanTween.alpha(imgGlow_01.rectTransform, 1f, tweenColorTime);
            yield return(new WaitUntil(() => _isFinished));
        }
    }
Beispiel #4
0
    public IEnumerator DoActionChangeBgColor(UnoGamePlayData.BackgroundColor _bgColor, bool _updateNow = true)
    {
        Color _c = bgColor_Yellow;

        switch (_bgColor)
        {
        case UnoGamePlayData.BackgroundColor.Red:
            _c = bgColor_Red;
            break;

        case UnoGamePlayData.BackgroundColor.Green:
            _c = bgColor_Green;
            break;

        case UnoGamePlayData.BackgroundColor.Blue:
            _c = bgColor_Blue;
            break;

        case UnoGamePlayData.BackgroundColor.Yellow:
            _c = bgColor_Yellow;
            break;
        }
        if (_updateNow)
        {
            imgBg.color = _c;
            yield break;
        }
        else
        {
            bool _isFinished = false;
            LeanTween.color(rectTransformBg, _c, 0.2f).setOnComplete(() => {
                _isFinished = true;
            });
            yield return(new WaitUntil(() => _isFinished));
        }
    }