Quest Manager

Presented by IQuestManager interface, this system provides functionality for processing quests.

To use this system, inject IQuestManager interface into your class, as shown below:

[Inject] private IQuestManager questManager;

Parameters in inspector

questsCollection reference to scriptable object which contains quests collection (all available quests and initial quests list, separately).

Available methods

void StartQuest(string questId)

This method starts quest by known questId. If this parameter is not correct or empty, this method will not do anything. questId string should have GUID format.

Example:

questManager.StartQuest("99ec04ae-e322-4e8c-9409-f924aae4150a");

void AddProgress(QuestTaskType questTaskType, int progress)

This method increments progress of all active quests which have a certain task type.

Examples:

questManager.AddProgress(QuestTaskType.GameWon, 1);
questManager.AddProgress(QuestTaskType.EnemiesDefeated, 1);

QuestInfo GetQuestInfo(string questId)

This method returns information about quest with certain ID.

Example:


This method returns current state of quest with certain ID. You can use this to get information about quest progress.

Example:


This method returns current progress for task taskType for quest with questId.

Example:


This method returns true, if quest is completed, otherwise it returns false.


This method returns true, if quest was started and is currently running.

Last updated