Integrating the system into your code

IMPORTANT! Don't forget to add the QuestsManager.cs script on scene!


Namespace

To use the system code, you need to include the namespace

    using QuestsSystem;

Quest activation

Quest activation occurs through a call to QuestsManager.

    QuestsManager.Instance.AddQuest(QuestsNames.YourQuest);

After creating/deleting/modifying a quest through the editor, it automatically creates the enum list with all quests in the project:

    public enum QuestsNames
    {
        QuestOne,
        QuestTwo
    }

Quest progress

If you have logic in the quest that needs to be updated after any action.

    QuestsManager.Instance.UpdateQuestProgress(QuestsNames.YourQuest);

Quest complete/remove

If the quest has been completed

    QuestsManager.Instance.RemoveQuest(QuestsNames.YourQuest, true);

If you want to remove a quest from the list without calling OnComplete

    QuestsManager.Instance.RemoveQuest(QuestsNames.YourQuest, false);