/// <summary>
        /// Activate next quest in the list using button
        /// </summary>
        private void ActivateQuest()
        {
            if (_currentQuestIndex >= quests.Count)
            {
                TooltipActionEvent?.Invoke(tooltipTextSO.NoMoreQuest);
                return;
            }

            _currentQuest = quests[_currentQuestIndex];
            _currentQuestIndex++;
            ChangeQuestActiveState(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Enables UI and fills all data to the text fields
        /// </summary>
        private void ActiveQuestHandler(QuestSO questSo)
        {
            for (int i = _listOfObjectiveImages.Count - 1; i >= 0; i--)
            {
                for (int j = _listOfObjectiveImages[i].Count - 1; j >= 0; j--)
                {
                    _listOfObjectiveImages[i][j].gameObject.SetActive(false);
                    objectiveListText[i].gameObject.SetActive(false);
                }
            }

            currentQuestRectTrans.gameObject.SetActive(true);

            _currQuest = questSo;

            questNameText.text = _currQuest.QuestName;

            // Set objective name visible on the UI
            for (int i = 0; i < _currQuest.Objective.Count; i++)
            {
                objectiveListText[i].text = _currQuest.Objective[i].ObjectiveName;
                objectiveListText[i].gameObject.SetActive(true);
            }

            // Set objective description icons visible on the UI
            for (int i = 0; i < _currQuest.Objective.Count; i++)
            {
                for (int j = 0; j < _currQuest.Objective[i].SpriteDescription.Count; j++)
                {
                    _listOfObjectiveImages[i][0].gameObject.SetActive(true);
                    _listOfObjectiveImages[i][j + 1].sprite = _currQuest.Objective[i].SpriteDescription[j];
                    _listOfObjectiveImages[i][j + 1].gameObject.SetActive(true);
                }
            }

            moneyText.text = $"{questSo.RewardQuest}";
        }