Пример #1
0
    private IEnumerator TurnColor(Color color)
    {
        score_text.DOColor(color, 0.1f);
        yield return(new WaitForSeconds(0.1f));

        score_text.DOColor(Color.white, 0.1f);
    }
Пример #2
0
    public IEnumerator StartCountdown(int countdownValue)
    {
        counting           = true;
        currCountdownValue = countdownValue;
        GameController.Instance.IncreaseTempo(0.025f);
        timer_text.DOFade(1, 0.5f);
        while (currCountdownValue >= 0)
        {
            yield return(new WaitForSeconds(1.0f));

            currCountdownValue--;
            timer_text.transform.DOShakeScale(0.1F, 0.5F, 2, 0, true);
            if (currCountdownValue == 3)
            {
                timer_text.DOColor(Color.red, 0.5f);
            }
            if (currCountdownValue == 0)
            {
                timer_text.DOFade(0.0f, 0.75f);
            }
        }
        StartCoroutine(StopCountdown());
        timer_text.DOColor(Color.white, 0.1f);
        counting = false;
    }
Пример #3
0
 public void DisplayCombo(int combo)
 {
     DOTween.Complete(comboLabel);
     comboLabel.text  = "Combo X " + combo;
     comboLabel.color = Utilities.ChangeColorAlpha(comboLabel.color, 1);
     comboLabel.DOColor(Utilities.ChangeColorAlpha(comboLabel.color, 0), 1f);
 }
    /// <summary>
    /// CoRoutine responsible for changing the color of the moves text.
    /// </summary>
    private IEnumerator ChangeTextColorRoutine()
    {
        MovesText.DOColor(Color.red, changeTextColorDuration);
        yield return(new WaitForSeconds(changeTextColorDuration));

        MovesText.DOColor(Color.white, changeTextColorDuration);
        yield return(new WaitForSeconds(changeTextColorDuration));
    }
Пример #5
0
    public void Kill()
    {
        Debug.Log("Toast mouse up");
        float oldY = GetComponent <RectTransform>().anchoredPosition.y;

        text.DOColor(new Color(0, 0, 0, 0), duration).SetDelay(duration * 0.5f);
        GetComponent <RectTransform>().DOAnchorPosY(50, duration).SetDelay(duration * 0.5f);
        Destroy(gameObject, duration);
    }
 public void FadeOffUI()
 {
     if (videoPlayer.clip != null)
     {
         targetColor = whiteAlpha0;
         rawImage.DOColor(targetColor, fadeOffDuration).OnComplete(() => fadeOffComplete = true);
         instructionText.DOColor(targetColor, fadeOffDuration);
     }
 }
Пример #7
0
        void HandleOnPenaltyTime(float penaltyTime, BlackHole blackHole)
        {
            // Add penalty
            //this.penaltyTime += penaltyTime;

            // Red flickering
            float    time = 0.5f;
            Sequence seq  = DOTween.Sequence();

            seq.Append(label.DOColor(Color.red, time));
            seq.Append(label.DOColor(Color.white, time));
            seq.SetLoops(3);
            seq.Play();
        }
Пример #8
0
        /// <summary>
        /// Opens the items list menu
        /// </summary>
        public override void Open()
        {
            gameObject.SetActive(true);

            PopUpManager.Instance.CloseAll();

            DOTween.Kill("timer");

            if (!GameManager.Instance.IsGameOver)
            {
                ItemList.SetActive(true);
            }
            else
            {
                ItemList.SetActive(false);
            }

            if (PlacementManager.Instance.InSceneObjectsCount < PlacementManager.Instance.MinObjectsInScene)
            {
                PlayButton.gameObject.SetActive(false);

                if (!PlacementManager.Instance.IsBallPlaced)
                {
                    SetPlayButtonState(PlayButtonState.Placement);
                }
            }
            else
            {
                PlayButton.gameObject.SetActive(true);

                if (PlacementManager.Instance.InSceneObjectsCount == PlacementManager.Instance.MinObjectsInScene && !PlacementManager.Instance.IsBallPlaced)
                {
                    PopUpManager.Instance.Show(1);

                    float timer = 0;
                    DOTween.To(() => timer, x => timer = x, 100, TimeToOpen).OnComplete(OpenMenuAndClosePopupAfterTimer).SetId("timer");
                }
            }

            if (!isOpen)
            {
                GetComponent <RectTransform>().DOAnchorPosY(0, 0.33f).SetEase(Ease.InOutSine).OnComplete(MenuAnimationCompleted);
                ItemList.GetComponent <RectTransform>().DOAnchorPosY(-2, 0.33f).SetEase(Ease.InOutSine);
                TitleText.DOColor(new Color(1, 1, 1, 0), 0.16f);
            }

            MenuButton.GetComponent <RectTransform>().DOLocalRotate(new Vector3(0, 0, 45), 0.33f);

            isOpen = true;
        }
Пример #9
0
    public IEnumerator DisplayLosePanel(int dealedDamage, float bossHP)
    {
        Debug.Log("lose!!!");

        dealedDamageLabel.text = "Dealed damage : " + dealedDamage;
        bossHPLabel.text       = "Boss HP Remaining : " + bossHP;
        yield return(new WaitForSeconds(2f));

        losePanel.gameObject.SetActive(true);
        losePanel.DOColor(Utilities.ChangeColorAlpha(losePanel.color, 1), 0.5f);
        yield return(new WaitForSeconds(0.5f));

        loseLabel.gameObject.SetActive(true);
        loseLabel.transform.DOMoveY(0, 0.5f).From();
        loseLabel.DOColor(Utilities.ChangeColorAlpha(loseLabel.color, 0), 0.5f).From();
        yield return(new WaitForSeconds(0.5f));

        dealedDamageLabel.DOColor(Utilities.ChangeColorAlpha(dealedDamageLabel.color, 1), 0.5f);
        yield return(new WaitForSeconds(0.5f));

        bossHPLabel.DOColor(Utilities.ChangeColorAlpha(bossHPLabel.color, 1), 0.5f);
        yield return(new WaitForSeconds(0.5f));

        btnTryAgain.DOColor(Utilities.ChangeColorAlpha(btnTryAgain.color, 150f / 255f), 0.5f);
        yield return(new WaitForSeconds(0.5f));

        btnExit.DOColor(Utilities.ChangeColorAlpha(btnExit.color, 150f / 255f), 0.5f);
    }
Пример #10
0
 public void FlashMoney()
 {
     MoneyText.DOKill();
     MoneyText.color = Color.white;
     MoneyText.DOColor(Color.red, 0.5f)
     .SetEase(Ease.Flash, 20);
 }
Пример #11
0
 public void WrongFeedback(Action callback)
 {
     text.DOColor(wrongColor, 0.75f);
     text.transform.DOShakePosition(0.75f, 3.5f, 50).OnComplete(
         () =>
     {
         callback();
         text.color = startColor;
     });
 }
Пример #12
0
        private void GenerateSequence(string newText)
        {
            Sequence sequence = DOTween.Sequence();

            sequence.Append(rectTransform.DOPivotX(0, inDurration).SetEase(easeIn));
            sequence.AppendInterval(textInStartDelay);
            sequence.Append(scoreTextField.DOColor(highlightColor, colorHighlightDurration).SetEase(colorHighlightEase));

            sequence.AppendCallback(() => { scoreTextField.text = newText; });
            sequence.AppendInterval(highlightDelay);

            sequence.Append(scoreTextField.DOColor(normalColor, colorNormalDurration).SetEase(colorNormalEase));
            sequence.AppendInterval(textInStartDelay);
            sequence.Append(rectTransform.DOPivotX(1, outDurration).SetEase(easeOut));

            sequence.Insert(inDurration + textInStartDelay, scoreTextField.rectTransform.DOScaleX(xMaxScale, colorHighlightDurration).SetEase(xScaleEase));
            sequence.Insert(inDurration + textInStartDelay + colorHighlightDurration + highlightDelay, scoreTextField.rectTransform.DOScaleX(1, colorNormalDurration).SetEase(xScaleOutEase));

            sequence.Play();
        }
Пример #13
0
    IEnumerator RunGoCoroutine()
    {
        text.text = "Go!";
        text.transform.DOScale(2, 0.25f);
        text.transform.DOScale(0, 0.75f).SetDelay(1f);
        text.DOColor(Color.clear, 0.75f).SetDelay(1f);
        goCue.Play(source);

        yield return(new WaitForSeconds(2f));

        text.enabled = false;
    }
Пример #14
0
        private void UpdateStateIcon(FileSourceState state)
        {
            if (_icon == null)
            {
                return;
            }

            // Kill all animations
            _icon.DOKill();

            // Skip strong animations on startup
            if (Time.time > 0.2f)
            {
                _icon.rectTransform.DOPunchScale(-0.7f * Vector3.one, 0.3f, 10, 0.5f)
                .OnKill(() =>
                {
                    if (_icon != null && _icon.rectTransform != null)
                    {
                        _icon.rectTransform.localScale = Vector3.one;
                    }
                });
            }

            if (state == Ok)
            {
                _icon.sprite = _okSprite;
            }
            else if (state == Refreshing)
            {
                _icon.sprite = _refreshingSprite;

                // Cycle highlight/default color and reset when done
                var color = _icon.color;
                _icon.DOColor(_highlightColor, duration: 0.7f)
                .SetLoops(-1, LoopType.Yoyo)
                .OnKill(() =>
                {
                    if (_icon != null)
                    {
                        _icon.color = color;
                    }
                });
            }
            else if (state == Deleting)
            {
                var color = new Color(0.8f, 0.2f, 0.3f);
                _icon.sprite = _okSprite;
                _text.DOColor(color, 0.1f);
                _icon.DOColor(color, 0.1f);
            }
        }
Пример #15
0
    public void DisplayPlayerAttack(string result, Color color, int comboStack, int damage)
    {
        //reset
        DOTween.Complete(resultLabel);
        DOTween.Complete(damageLabel);
        sequence = DOTween.Sequence();

        //display result
        sequence.AppendCallback(() =>
        {
            PlayResultSpaceSound(result);
            resultLabel.text  = result;
            resultLabel.color = Utilities.ChangeColorAlpha(color, 1);

            comboLabel.text  = "Combo X " + comboStack;
            comboLabel.color = Utilities.ChangeColorAlpha(comboLabel.color, 1);
        });
        sequence.Append(resultLabel.DOColor(Utilities.ChangeColorAlpha(resultLabel.color, 0), 1f));
        sequence.Join(comboLabel.DOColor(Utilities.ChangeColorAlpha(comboLabel.color, 0), 1f));

        //display damage
        sequence.AppendCallback(() =>
        {
            damageLabel.text  = damage.ToString();
            damageLabel.color = Utilities.ChangeColorAlpha(Color.white, 1);
        });
        sequence.Append(damageLabel.DOColor(Utilities.ChangeColorAlpha(Color.red, 0), 2f));
        sequence.Join(damageLabel.transform.DOLocalMoveY(0, 2f).From());

        //TO DO: ANIMATION lose health
        sequence.Play();
        sequence.OnStart(() => {
            enemy.TakeDamage(damage);
            DOTween.Complete(Camera.main);
            Camera.main.DOShakePosition(1f, 5, 10);
        });
    }
Пример #16
0
    public void WinnerPresentRPC(string nick)
    {
        winEvent.Invoke();
        winnerNickname   = nick;
        winnerText.text  = nick;
        winnerText.color = new Color(1.0f, 1.0f, 1.0f, 0.0f);
        foreach (var image in winObjImages)
        {
            image.color = new Color(1.0f, 1.0f, 1.0f, 0.0f);
        }

        winObject.SetActive(true);
        winnerText.DOColor(Color.white, fadeInTime);
        foreach (var image in winObjImages)
        {
            image.DOColor(Color.white, fadeInTime);
        }
    }
Пример #17
0
    //  -------------------------- win panel ---------------------------
    public IEnumerator DisplayWinPanel()
    {
        yield return(new WaitForSeconds(2f));

        winPanel.gameObject.SetActive(true);
        winPanel.DOColor(Utilities.ChangeColorAlpha(winPanel.color, 1), 0.5f);
        yield return(new WaitForSeconds(0.5f));

        winLabel.DOColor(Utilities.ChangeColorAlpha(winLabel.color, 1f), 0.5f);
        yield return(new WaitForSeconds(0.5f));

        congrat.DOColor(Utilities.ChangeColorAlpha(congrat.color, 1f), 0.5f);
        yield return(new WaitForSeconds(0.5f));

        cardBack.DOColor(Utilities.ChangeColorAlpha(cardBack.color, 1f), 0.5f);
        yield return(new WaitForSeconds(0.5f));

        btnGallery.DOColor(Utilities.ChangeColorAlpha(btnGallery.color, 1f), 0.5f);
        btnNext.DOColor(Utilities.ChangeColorAlpha(btnNext.color, 1f), 0.5f);
    }
Пример #18
0
 public void DisplayRunningOut()
 {
     runningOutLabel.DOColor(Utilities.ChangeColorAlpha(runningOutLabel.color, 1), 0.5f).SetLoops(-1, LoopType.Yoyo);
 }
Пример #19
0
 protected override TweenerCore <Color, Color, ColorOptions> LerpColor(Color endColor, float duration)
 {
     return(text.DOColor(endColor, duration));
 }
Пример #20
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            GetComponentInChildren <AudioSource>().Stop();
            GetComponentInChildren <AudioSource>().clip = clickSound;
            GetComponentInChildren <AudioSource>().Play();
        }
        if (flowchart.GetBooleanVariable("info"))
        {
            InfoPanelDown();
            affinityInfo.SetActive(true);
            mentalInfo.SetActive(true);
        }
        else
        {
            affinityInfo.SetActive(false);
            mentalInfo.SetActive(false);
            bool hover = RectTransformUtility.RectangleContainsScreenPoint(
                valuePanel.GetComponent <RectTransform>(), Input.mousePosition, null);
            bool value_button = RectTransformUtility.RectangleContainsScreenPoint(
                hoverButton.GetComponent <RectTransform>(), Input.mousePosition, null);

            if (panelDown)
            {
                if (!hover && !value_button)
                {
                    panelUpTimer += Time.deltaTime;
                    if (panelUpTimer >= 3)
                    {
                        panelUpTimer = 0;
                        panelDown    = false;
                        InfoPanelUp();
                    }
                }
                else
                {
                    panelUpTimer = 0;
                }
            }
            else
            {
                if (value_button)
                {
                    InfoPanelDown();
                }
            }
        }


        affinityText.text = affinityDisplay.ToString();
        mentalText.text   = mentalDisplay.ToString();

        if (affinityDisplay < 0)
        {
            affinityText.DOColor(new Color(1, 203f / 255f, 0), 1f);
        }
        else
        {
            affinityText.DOColor(new Color(0, 1, 0), 1f);
        }

        if (mentalDisplay < 0)
        {
            mentalText.DOColor(new Color(1, 203f / 255f, 0), 1f);
        }
        else
        {
            mentalText.DOColor(new Color(0, 1, 0), 1f);
        }

        if (flowchart.GetBooleanVariable("showMoral"))
        {
            gameState = GameState.end;
        }
    }
Пример #21
0
 void Start()
 {
     text = this.gameObject.GetComponent <TMP_Text>();
     text.DOColor(new Color(0, 0, 0, 1f), 5f).SetEase(Ease.Linear);
     StartGame();
 }
Пример #22
0
 private void ButtonOnClicked()
 {
     _text.DOKill(true);
     _text.DOColor(_updateAvailableColor, 0.1f);
 }
Пример #23
0
 void Highlight(bool b)
 {
     placeName.DOColor(b?Color.grey:Color.white, 0.15f);
 }