IQuest
Quest Service
Interface
Basic interface Quest component
Properties
celebrateOnComplete | If enabled, a confetti animation will play when the quest is completed. |
description | Short description of what the quest objective is. |
hideToastMessageOnComplete | Affects VR devices only. If true, toast messages will not be displayed when the quest or its tasks are completed. |
id | Unique ID of the quest. |
name | Name of the quest. |
rewards | Rewards for completing the quest. |
saveUserProgress | If enabled, the user's progress will be saved to the cloud and restored when they rejoin the space. If disabled, the quest progress is reset on the next join. |
status | Gets the status of the quest. |
tasks | Tasks that need to be completed to finish the quest. |
tasksAreOrdered | If true, only the first task will be started and once it’s completed, the next task will start. If false, all tasks are automatically started when the quest completes. |
Methods
AddBadgeReward(string) | Adds a badge reward to the quest. |
AddItemReward(string, int) | Adds an item reward to the quest. |
AddTask(string, QuestTaskType, int, GameObject[]) | Adds a task to the task list |
Complete() | Completes the quest. |
GetTaskByID(uint) | Gets a task by ID. |
Reset() | Resets the quest (all tasks are reset and the quest status is marked as None) |
SetOnCompleted(Action) | Sets the onCompleted action and returns the quest. |
SetOnPreviouslyCompleted(Action) | Sets the onPreviouslyCompleted action and returns the quest. |
SetOnReset(Action) | Sets the onReset action and returns the quest. |
SetOnStarted(Action) | Sets the onStarted action and returns the quest. |
Start() | Starts the quest. |
Events
onCompleted | Event called when this quest is completed. |
onPreviouslyCompleted | Event that is triggered when the user loads into a space where a quest was previously completed. Only used when ISpatialQuest.saveUserProgress is set to true. This event allows you to “fast forward” any settings in the scene that should be enabled if a quest was previously completed. |
onReset | Event called when this quest is reset. |
onStarted | Event called when this quest is started. |
onTaskAdded | Event called when a task is added to the quest. |