Skip to content

Commit 46bccc1

Browse files
committed
docs: updated docs for 2.0 release
1 parent 6cc17fe commit 46bccc1

File tree

3 files changed

+45
-10
lines changed

3 files changed

+45
-10
lines changed

Diff for: README.md

+35
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ A Unity 3D package for managing quests with sub-tasks. Inspired by Skyrim and Th
1212
* Customizable drop in example prefab to easily get a quest GUI up and running in minutes
1313
* Save / load support out of the box
1414
* Heavily tested with TDD
15+
* Includes event hooks to distribute rewards, update UI, and other game logic
1516

1617
**Support**
1718

@@ -105,6 +106,34 @@ Found in `Assets/Examples/DebugQuestPrint/DebugQuestPrint.scene`. A useful scene
105106

106107
## Recipes
107108

109+
### Event Hooks
110+
111+
You can hook into quest state changes with the following hooks. This is extremely useful for granting rewards, detecting task changes, updating UI, and other game logic.
112+
113+
NOTE: Make sure you remove the event listener when the listening object is destroyed to prevent memory leaks.
114+
115+
```c#
116+
// Triggers when a quest is added to the collection. Generally useful for UI updates
117+
QuestJournalManager.Instance.Quests.EventQuestAdd.AddListener((quest) => {
118+
// Your logic here
119+
});
120+
121+
// Triggers when a quest is completed due to running out of tasks. Useful for quest completion post processing events
122+
QuestJournalManager.Instance.Quests.EventQuestComplete.AddListener((quest) => {
123+
// Your logic here
124+
});
125+
126+
// Triggered when a quest has a task change. A good place to update your UI if you are displaying quest progress
127+
QuestJournalManager.Instance.Quests.EventQuestUpdate.AddListener((quest) => {
128+
// Your logic here
129+
});
130+
131+
// Triggers whenever a task is completed with the corresponding quest and task instance. Useful to fire post processing events with completed tasks.
132+
QuestJournalManager.Instance.Quests.EventQuestTaskComplete.AddListener((quest, task) => {
133+
// Your logic here
134+
});
135+
```
136+
108137
### Save And Load
109138

110139
Unity Quest Journal supports save and load functionality out of the box. You can execute a save of your current quest states as so.
@@ -169,6 +198,12 @@ var taskDefinition = QuestJournalManager.Instance.Quests
169198
.Definition as MyCustomTaskDefinition;
170199
```
171200

201+
### Hiding Default Quest and Task
202+
203+
If you've written your own custom tasks you probably don't want the default ones to show up in the inspector. You can hide them by clicking the following checkboxes in your settings object.
204+
205+
![Hide default quest and task](docs/hide-default-quest-and-task.png)
206+
172207
## Releases
173208

174209
Archives of specific versions and release notes are available on the [releases page](https://github.com/ashblue/unity-quest-journal/releases).

Diff for: UserSettings/Layouts/default-2023.dwlt

+10-10
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ MonoBehaviour:
1919
width: 2560
2020
height: 1349.3334
2121
m_ShowMode: 4
22-
m_Title: Game
22+
m_Title: Inspector
2323
m_RootView: {fileID: 2}
2424
m_MinSize: {x: 875, y: 300}
2525
m_MaxSize: {x: 10000, y: 10000}
@@ -118,7 +118,7 @@ MonoBehaviour:
118118
m_MinSize: {x: 300, y: 100}
119119
m_MaxSize: {x: 24288, y: 16192}
120120
vertical: 1
121-
controlID: 50
121+
controlID: 122
122122
--- !u!114 &6
123123
MonoBehaviour:
124124
m_ObjectHideFlags: 52
@@ -143,7 +143,7 @@ MonoBehaviour:
143143
m_MinSize: {x: 300, y: 100}
144144
m_MaxSize: {x: 24288, y: 16192}
145145
vertical: 0
146-
controlID: 51
146+
controlID: 123
147147
--- !u!114 &7
148148
MonoBehaviour:
149149
m_ObjectHideFlags: 52
@@ -168,7 +168,7 @@ MonoBehaviour:
168168
m_MinSize: {x: 200, y: 100}
169169
m_MaxSize: {x: 16192, y: 16192}
170170
vertical: 1
171-
controlID: 52
171+
controlID: 43
172172
--- !u!114 &8
173173
MonoBehaviour:
174174
m_ObjectHideFlags: 52
@@ -193,7 +193,7 @@ MonoBehaviour:
193193
m_MinSize: {x: 200, y: 50}
194194
m_MaxSize: {x: 16192, y: 8096}
195195
vertical: 0
196-
controlID: 42
196+
controlID: 44
197197
--- !u!114 &9
198198
MonoBehaviour:
199199
m_ObjectHideFlags: 52
@@ -482,7 +482,7 @@ MonoBehaviour:
482482
scrollPos: {x: 0, y: 0}
483483
m_SelectedIDs:
484484
m_LastClickedID: 0
485-
m_ExpandedIDs: 3a23ffff2037ffff3037ffffc038ffff623bffffd03dfffffc3fffff9e42ffffc844fffff847ffff1a4affffac4bffffce4dfffff04fffff9652ffff6055fffff256ffffbc59ffffde5bffff845effff2a61ffff4c63ffff6c65ffff8c67ffffac69ffffcc6bffff606dffff6cbbffff6ebbffff88bdfffff4ffffff
485+
m_ExpandedIDs: 0efbffff
486486
m_RenameOverlay:
487487
m_UserAcceptedRename: 0
488488
m_Name:
@@ -2630,7 +2630,7 @@ MonoBehaviour:
26302630
m_SkipHidden: 0
26312631
m_SearchArea: 1
26322632
m_Folders:
2633-
- Assets/Examples/DebugQuestPrint
2633+
- Assets/com.fluid.quest-journal/Runtime/Scripts/Quests/Definitions
26342634
m_Globs: []
26352635
m_ProductIds:
26362636
m_AnyWithAssetOrigin: 0
@@ -2640,15 +2640,15 @@ MonoBehaviour:
26402640
m_ViewMode: 1
26412641
m_StartGridSize: 16
26422642
m_LastFolders:
2643-
- Assets/Examples/DebugQuestPrint
2643+
- Assets/com.fluid.quest-journal/Runtime/Scripts/Quests/Definitions
26442644
m_LastFoldersGridSize: 16
26452645
m_LastProjectPath: C:\Users\truef\Programming\unity\unity-quest-journal
26462646
m_LockTracker:
26472647
m_IsLocked: 0
26482648
m_FolderTreeState:
26492649
scrollPos: {x: 0, y: 0}
2650-
m_SelectedIDs: b6830000
2651-
m_LastClickedID: 33718
2650+
m_SelectedIDs: e4780000
2651+
m_LastClickedID: 30948
26522652
m_ExpandedIDs: 000000005478000056780000587800005a7800005c7800005e78000060780000627800006478000066780000
26532653
m_RenameOverlay:
26542654
m_UserAcceptedRename: 0

Diff for: docs/hide-default-quest-and-task.png

38 KB
Loading

0 commit comments

Comments
 (0)