How To: Assign Quest Machine UIs
Posted: Sat Nov 21, 2020 10:07 am
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.)
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.
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.