Exemplo n.º 1
0
    private IEnumerator DelayPassDay()
    {
        yield return(new WaitForSeconds(0.21f));

        if (_msgDict.ContainsKey(PassDays))
        {
            if (_msgDict[PassDays].Count > _msgIndex)
            {
                CardContainer.ShowMsgCard(_msgDict[PassDays][_msgIndex]);
                _msgIndex++;
                yield break;
            }
        }

        if (!_isShowCard)
        {
            _isShowCard = true;
            CardContainer.ShowNextCard();
            yield break;
        }

        NewDayText.text = EndDays.Value.ToString();
        NewDayAnim.gameObject.SetActive(true);
        NewDayAnim.Play("NewDay" + Random.Range(0, 2));
        yield return(new WaitForSeconds(0.3f / AnimSpeed));

        EndDay();
        if (IsGameOver)
        {
            yield break;
        }
        yield return(new WaitForSeconds(0.18f / AnimSpeed));

        if (PassDays > 0 && PassDays % StageAddInterval == 0)
        {
            Stage++;
            CardContainer.Shuffle(Stage);
        }
        NewDay();

        yield return(new WaitForSeconds(1f));

        NewDayAnim.gameObject.SetActive(false);
    }
Exemplo n.º 2
0
    public void RestartGame()
    {
        Debug.Log("RestartGame");
        PlayBgm(MainBgm);
        Stage     = 1;
        PassDays  = 0;
        _msgIndex = 0;
        GameOverPanel.Hide();
        StopAllCoroutines();
        IsGameOver = false;
        EventManager.TriggerEvent(GameEvent.RestartGame);
        foreach (var property in AllProperty)
        {
            property.ResetValue();
        }
        CardContainer.Shuffle(Stage);

        NewDay(true);
    }