Heroic Engine
  • Welcome
  • Getting Started
    • Quickstart
    • Example Games
      • Tic Tac Toe
      • Turn based duel
  • Basics
    • Injection Manager
    • Engine Systems
      • Core Systems
        • Events Manager
        • Input Manager
        • Localization Manager
          • LangText component
        • Music Player
        • Sounds Manager
        • Time Manager
        • Scenes Loader
        • Day Time Controller
        • Weather Controller
      • Gameplay Systems
        • Currencies Manager
        • Player Progression Manager
        • Quest Manager
        • Random Events Manager
        • Hittables Manager
        • Dungeon Generator
      • UI Systems
        • UI Controller
        • Countdown Controller
    • Editor Tools
      • Clear Saves
      • Mobile Build Optimizer
      • Create System
      • Icon from Prefab Generator
    • Engine Utilities
      • PoolSystem
      • DataSaver
      • ComponentExtensions
      • MaterialExtensions
      • SpriteUtils
      • SlowUpdate
      • StringUtils
      • TypeUtility
      • MathHelper
      • VectorUtils
      • TransformUtils
      • MeshUtils
    • Useful Components
      • Floating Item
      • Fly Up Text
      • Label Scaler
      • Ragdoll
      • Rotate To Camera
      • Orbital Camera
      • Rotator
      • Texture Mover
      • Hittable
      • Projectile
      • Projectile2D
      • LifetimeObject
      • Spawner
      • Colorized Particles
      • Draggable2D
      • SaveableTransform
    • Useful Attributes
Powered by GitBook
On this page
  • Parameters in inspector
  • Available methods
  1. Basics
  2. Engine Systems
  3. Gameplay Systems

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:

QuestInfo questInfo = questManager.GetQuestInfo("99ec04ae-e322-4e8c-9409-f924aae4150a");

Debug.Log("Quest title: " + questInfo.Title);
Debug.Log("Quest desc: " + questInfo.Description);

QuestState GetQuestState(string questId)

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

Example:

QuestState questState = questManager.GetQuestState(questId);

Debug.Log($"First task progress: {questState.QuestProgress[0]}");

int GetQuestTaskProgress(string questId, QuestTaskType taskType)

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

Example:

int enemiesDefeated = questManager.GetQuestTaskProgress(questId, QuestTaskType.EnemiesDefeated);

Debug.Log($"Enemies defeated: {enemiesDefeated}");

bool IsQuestCompleted(string questId)

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


bool IsQuestActive(string questId)

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

PreviousPlayer Progression ManagerNextRandom Events Manager

Last updated 5 months ago