Esempio n. 1
0
    /// <summary>
    /// This will decide if the player is starting an interact or leaving a area where the player had interacted.
    /// Either showing or hiding an interact dialog box that gives the player information via text.
    /// </summary>
    /// <param name="eventInfo"></param>
    private void ShowQuestDialog(EventInfo eventInfo)
    {
        QuestDialogEventInfo questDialog = (QuestDialogEventInfo)eventInfo;

        if (questDialog.show == true)
        {
            descriptionPanel.gameObject.SetActive(true);
            questDescription.text = questDialog.questText;
        }
        else
        {
            descriptionPanel.gameObject.SetActive(false);
            questDescription.text = "";
        }
    }
Esempio n. 2
0
    /// <summary>
    /// If the player exit contact with the quest giver then a InteractTriggerEvent is called;
    /// </summary>
    /// <param name="other">Gameobjects Collider</param>
    private void OnTriggerExit(Collider other)
    {
        if (enabled == false)
        {
            return;
        }
        InteractTriggerEventInfo itei = new InteractTriggerEventInfo {
            isInteractable = false
        };

        EventHandeler.Current.FireEvent(EventHandeler.EVENT_TYPE.Interact, itei);

        QuestDialogEventInfo questDialogEvent = new QuestDialogEventInfo {
            questText = CurrentStateDialog(), show = false
        };

        EventHandeler.Current.FireEvent(EventHandeler.EVENT_TYPE.QuestDialog, questDialogEvent);
    }
Esempio n. 3
0
    public void ControllInput()
    {
        if (enabled == true)
        {
            QuestDialogEventInfo questDialogEvent = new QuestDialogEventInfo {
                questText = CurrentStateDialog(), show = true
            };
            EventHandeler.Current.FireEvent(EventHandeler.EVENT_TYPE.QuestDialog, questDialogEvent);
        }

        if (QuestComponent.IsCompleted(questID))
        {
            TurnInQuest();
        }
        else if (QuestComponent.IsCompleted(questIDRecuirement) == false || QuestComponent.IsCompleted(alternativeIDRequired) == false && this.enabled == true)
        {
            return;
        }
        else if (started == false)
        {
            StartTheQuest();
        }
    }