How To: Assign Quest Machine UIs

Announcements, support questions, and discussion for Quest Machine.
Post Reply
User avatar
Tony Li
Posts: 21080
Joined: Thu Jul 18, 2013 1:27 pm

How To: Assign Quest Machine UIs

Post by Tony Li »

If you don’t want to customize the appearance of the existing template UI elements, you can delete them, create your own new elements, and assign those new elements to the UI components’ fields. To assign to Quest Machine’s UI fields (e.g., IQuestDialogueUI), you must drag the component itself, not the GameObject that contains it. (Technical details: This is because the field is a C# interface, not a regular class type. The Unity inspector doesn’t normally accept C# interfaces, but Quest Machine uses a custom property drawer to accept them, the restriction being that you must drag the component itself into the field.)

assignQMUI.png
assignQMUI.png (65.17 KiB) Viewed 802 times

Side note: To implement custom UI code instead of using the built-in Unity UI implementations, simply implement the relevant C# interface: IQuestDialogueUI,IQuestJournalUI,IQuestHUD, or IQuestAlertUI. The interface scripts are fully documented.
If you create custom content types, you will need to write a custom UI implementation or at least make a subclass of the built-in Unity UI implementation to handle the new content type.
Post Reply