Exemplo n.º 1
0
    public virtual void Start()
    {
        questStartedEvent  = new QuestStartedEvent();
        questFinishedEvent = new QuestFinishedEvent();

        playerController = FindObjectOfType <Player>();


        //For resting leave this in start
        //StartQuest();
    }
        /// <summary>
        /// Change state of current quest
        /// </summary>
        /// <param name="newState"></param>
        private void ChangeQuestActiveState(bool newState)
        {
            _isQuestActive = newState;

            activateQuestButton.interactable = !newState;
            finishQuestButton.interactable   = newState;

            objective1.interactable = objective2.interactable = objective3.interactable = newState;

            if (newState)
            {
                string endValue = string.Format(tooltipTextSO.QuestActive, _currentQuest.QuestName);

                QuestActiveEvent?.Invoke(_currentQuest);
                TooltipActionEvent?.Invoke(endValue);
            }
            else
            {
                string endValue = string.Format(tooltipTextSO.QuestFinished, _currentQuest.QuestName);

                QuestFinishedEvent?.Invoke();
                TooltipActionEvent?.Invoke(endValue);
            }
        }
Exemplo n.º 3
0
 void Awake()
 {
     questFinishedEvent = new QuestFinishedEvent();
     quests             = questObject.GetComponents <Quest>();
 }
 public static void SendQuestFinished(Quest quest, QuestResult qr)
 {
     QuestFinishedEvent?.Invoke(quest, qr);
 }