Esempio n. 1
0
        private void NextDayStep()
        {
            TimeUtilities.ExecuteAfterDelay(() => {
                NextDayStep();
            }, 2.5f, this);

            CurrentDay++;
            OnNextDay();

            StartCoroutine(SunRotateRoutine(true));
        }
Esempio n. 2
0
        private void NextDayStep()
        {
            if (m_QuestsToAssign.Count != 0)
            {
                QuestInstance nextQuest = m_QuestsToAssign[m_QuestsToAssign.Count - 1];
                m_QuestsToAssign.Remove(nextQuest);

                QuestDetailsWindow.Instance.OpenWindow(nextQuest, QuestDetailsWindowMode.HERO_SELECT);
                m_CurrentDayStep++;
                return;
            }

            while (m_ActiveQuestsToUpdate.Count != 0)
            {
                QuestInstance activeQuest = m_ActiveQuestsToUpdate[m_ActiveQuestsToUpdate.Count - 1];
                activeQuest.DaysLeftOnQuest--;

                m_ActiveQuestsToUpdate.Remove(activeQuest);

                if (activeQuest.DaysLeftOnQuest <= 0)
                {
                    QuestDetailsWindow.Instance.OpenWindow(activeQuest, QuestDetailsWindowMode.COMPLETED);
                    activeQuest.CompleteQuest(QuestManager.ActiveQuests[activeQuest]);
                    m_CurrentDayStep++;
                    return;
                }
            }

            if (m_CurrentDayStep == 0)
            {
                nothingToReportUI.SetActive(true);
                TimeUtilities.ExecuteAfterDelay(() => {
                    nothingToReportUI.SetActive(false);
                    NextDayStep();
                }, 2.5f, this);
                m_CurrentDayStep++;
                return;
            }

            CurrentDay++;

            OnNextDay();

            QuestManager.PostedQuests = UpdateQuestTimeLimits(QuestManager.PostedQuests, 0);
            QuestManager.Requests     = UpdateQuestTimeLimits(QuestManager.Requests, 0);
            InventoryManager.Gold    -= 4;

            StartCoroutine(SunRotateRoutine(true));
            NightFadeUI.Instance.Disable(() => { });
            QuestDetailsWindow.Instance.OnWindowClose -= NextDayStep;
        }