Check out this thread: Tracking kills for Quests? - #17 by Mythran
Making a second root node (or as many as you want) is actually relatively easy… just create a child node from the root, and then delete the connection.
The tricky part is GETTING all of the root nodes.
Here’s a hot take on this, though it may be smarter to cache these values somehow:
public IEnumerable<DialogueNode> GetRootNodes()
{
foreach (DialogueNode node in GetAllNodes())
{
bool isChild = false;
foreach (DialogueNode lookupNode in GetAllNodes())
{
if (lookupNode.GetChildren().Contains(node.name))
{
isChild = true;
break;
}
}
if (!isChild) yield return node;
}
}
This searches through each node, then searches through each node against that node to see if it is a child node of another node. If it is, then it’s not returned, if it’s a root node, then it won’t be a child of any other node.
Then you can filter the results of GetNodes() to find the best node to display.