This can be a bit complicated. I’ll show you some untested code to give an idea of how I would approach this.
// probably easiest to modify the sample UI's script.
// you will probably have something like this at the top of the script to link the UI Image elements with
UnityEngine.UI.Image questIconUI = new UnityEngine.UI.Image;
UpdateDialoguePanel() might be modified to something like this.
public void UpdateDialoguePanel()
// get the waiting node. I will cast it to Dialogue Node type since that is
// only "waiting type" node that this code supports. So if it was not correct
// type then the dialogue panel will close.
DiaQNode_Dlg node = DiaQEngine.Instance.graphManager.NodeWaitingForData() as DiaQNode_Dlg;
if (node != null)
// first hide all the quest icons since they might not be used for this node
for (int i = 0; i < questIconUI.Length; i++)
// check if this Node has a linked to a Quest
object questIDObj = node.GetMetaDataValue("QuestID");
DiaQuest quest = questIDObj == null ? null : DiaQEngine.Instance.questManager.GetQuestById((int)questIDObj);
// get the reward icons if there is a linked quest
if (quest != null)
int uiIdx = 0;
for (int i = 0; i < quest.rewards.Count; i++)
// get the sprite. skip if none found, else set a UI element
Sprite sp = quest.rewards[i].GetMetaDataValue("icon") as Sprite;
if (sp != null)
questIconUI[uiIdx].sprite = sp;
You will note there are two types of meta being used here. The 1st asks the dialogue node if it is linked to a quest. That is done by adding the meta
QuestID (an Integer) to a node. If it is not present then it is assumed that Node is not related to a Quest. The quest Id, 0, I found by looking at the ID in the inspector of the Quest.
Now each reward in the quest must be given a Sprite icon. Add meta for each with the name
icon (a UnityObject type) and drop a sprite object into each.