Пример #1
0
    public void Update( )
    {
        if (_prevPlayerScore != playerScore.value)
        {
            scoreText.color = Color.white;

            scoreText.DOKill( );
            scoreText.transform.DOKill( );

            if (playerScore.value < 0)
            {
                signText.SetText("-");
                signText.color = Color.red;
            }
            else
            {
                signText.SetText("+");
                signText.color = Color.green;
            }

            scoreText.SetText(Mathf.Abs(playerScore.value).ToString( ));

            //scoreText.color = Color.clear;
            scoreText.transform.localPosition = _lerpFromPosition;

            //scoreText.DOColor( Color.white, 0.25f );
            scoreText.transform.DOLocalMoveY(_originPosition.y, 0.25f);

            _prevPlayerScore = playerScore.value;
        }
    }
Пример #2
0
 public void FlashMoney()
 {
     MoneyText.DOKill();
     MoneyText.color = Color.white;
     MoneyText.DOColor(Color.red, 0.5f)
     .SetEase(Ease.Flash, 20);
 }
    public void BeginDynasty()
    {
        GameState state = GameManager.instance.state;

        if (String.IsNullOrWhiteSpace(inputField.text))
        {
            AudioManager.instance.Play("Invalid");
            nameWarning.text = "Please enter a dynasty name!";
            nameWarning.DOKill();
            nameWarning.DOFade(1, .1f).OnComplete(() => nameWarning.DOFade(0, 1f).SetDelay(.2f));
            return;
        }
        else if (state.CheckForReusedName(inputField.text))
        {
            AudioManager.instance.Play("Invalid");
            nameWarning.text = "Please enter a new dynasty name!";
            nameWarning.DOKill();
            nameWarning.DOFade(1, .1f).OnComplete(() => nameWarning.DOFade(0, 1f).SetDelay(.2f));
            return;
        }

        //create dynasty
        Dynasty newDynasty = new Dynasty(inputField.text, state.m_turn, 0);

        state.m_currentDynasty = newDynasty;
        state.m_allDynasties.Add(newDynasty);

        //Set up perks
        state.m_perks.Clear();
        foreach (PerkChoice choice in perkChoices)
        {
            state.m_perks.Add(choice.perk);
            choice.Toggle();
        }
        perkChoices.Clear();

        inputField.text = "";

        //Hide self and tell map to start
        ShowSelf(false);
        AudioManager.instance.Play("GameStart");
        mapManager.StartDynasty();
    }
Пример #4
0
    public void Alert(string alert, float alertTime = ALERT_TIME)
    {
        AudioManager.instance.Play("Blip");

        m_alertText.text = alert;
        m_alertText.DOKill(true);
        m_alertText.transform.DOKill(true);
        m_alertText.rectTransform.DOKill(true);
        m_alertText.DOFade(1, alertTime / 2).OnComplete(() => m_alertText.DOFade(0, alertTime / 2));
        m_alertText.rectTransform.DOAnchorPosY(100, alertTime).OnComplete(() => m_alertText.rectTransform.anchoredPosition = Vector2.zero);
    }
Пример #5
0
    public void PlayGame()
    {
        if (String.IsNullOrWhiteSpace(input.text))
        {
            nameWarning.text = "Please enter an empire name!";
            nameWarning.DOKill();
            nameWarning.DOFade(1, .1f).OnComplete(() => nameWarning.DOFade(0, 1f).SetDelay(.2f));
            return;
        }

        AudioManager.instance.Play("GameStart");

        KillTweens();
        GameManager.instance.state.m_EmpireName = input.text;
        Faction playerFaction = new Faction(image.color);

        playerFaction.SetAsPlayer();
        GameManager.instance.LoadGame();
    }
Пример #6
0
 public void Notice(string notice)
 {
     m_noticeText.text = notice;
     m_noticeText.DOKill();
     m_noticeText.DOFade(1, .1f).OnComplete(() => m_noticeText.DOFade(0, 1f).SetDelay(.2f));
 }
Пример #7
0
 private void ButtonOnClicked()
 {
     _text.DOKill(true);
     _text.DOColor(_updateAvailableColor, 0.1f);
 }