예제 #1
0
 public void NewDay(bool isFirstDay = false)
 {
     if (IsGameOver)
     {
         return;
     }
     if (!isFirstDay)
     {
         PassDays++;
     }
     Debug.Log("NewDay PassDays = " + PassDays);
     _isShowCard = false;
     if (PassDays >= 5 && PassDays % 5 == 0)
     {
         CardContainer.ShowMsgCard("联盟的固定补给终于心不甘情不愿地发下来了", new CardConfigData {
             Yesmoney = 5, Nomoney = 5
         });
     }
     else if (_msgDict.ContainsKey(PassDays) && _msgDict[PassDays].Count > _msgIndex)
     {
         CardContainer.ShowMsgCard(_msgDict[PassDays][_msgIndex]);
         _msgIndex++;
     }
     else
     {
         _isShowCard = true;
         CardContainer.ShowNextCard();
     }
     EventManager.TriggerEvent(GameEvent.NewDay);
 }
예제 #2
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);
    }