public override void InstallNode(GameObject workingNode) { OrderedOptionUniqueIDs = new List <string>(); workingNode.AddComponent <AC.RememberConversation>(); workingNode.AddComponent <AC.Conversation>(); ChildNodes = new List <string>(); // Get all the node options linked to this seed foreach (int connectionKey in ActiveConnections.Keys) { AbstractNode childNode = db.GetNodeByUniqueID(ActiveConnections[connectionKey]); if (childNode.GetType() == typeof(DialogOption)) { childNode.InstallNode(workingNode); List <string> childs = childNode.GetChildNodes(); foreach (string childUniqueID in childs) { ChildNodes.Add(childUniqueID); } } // If it's a varcheck, then we will get all its childs, // add them as buttons into the dialog and then get the // childs of those DialogOptions and add them into the // ChildNodes list else if (childNode.GetType() == typeof(VarCheck)) { childNode.InstallNode(workingNode); } } }
public override bool CanConnectNode(AbstractNode NodeTarget) { if (NodeTarget.GetType() == typeof(DialogSeed) || NodeTarget.GetType() == typeof(Speech)) { return(true); } return(false); }
public override bool CanConnectNode(AbstractNode NodeTarget) { if (NodeTarget.GetType() == typeof(DialogOption) || NodeTarget.GetType() == typeof(VarCheck)) { return(true); } return(false); }
public override void InstallNode(GameObject workingNode) { // Get all childs and install them. foreach (int connectionKey in ActiveConnections.Keys) { String childUniqueID = ActiveConnections[connectionKey]; AbstractNode childNode = db.GetNodeByUniqueID(childUniqueID); if (childNode.GetType() == typeof(DialogOption)) { childNode.InstallNode(workingNode); ChildNodes.AddRange(childNode.GetChildNodes()); // We get the parent node (conversation seed node) and then add to the // ordered option unique ids this uniqueID. String parentNodeUniqueID = workingNode.name; DialogSeed parentSeed = (DialogSeed)db.GetNodeByUniqueID(parentNodeUniqueID); AC.Conversation dialogScript = workingNode.GetComponent <AC.Conversation>(); AssignedOptionButtons.Add( connectionKey, dialogScript.options.Last() ); parentSeed.CheckerList.Add(this); } } }
protected List <AbstractNode> RecursiveCheckChildren(Speech node, GameObject workingNode) { List <AbstractNode> returnList = new List <AbstractNode>(); AC.DialogueOption dialogueOption = GetDialogueOption(workingNode); AddSpeechToDialog(node, dialogueOption); foreach (int childKey in node.GetActiveConnections().Keys) { AbstractNode childNode = db.GetNodeByUniqueID(node.GetActiveConnections()[childKey]); if (childNode.GetType() == typeof(Speech)) { returnList.AddRange(RecursiveCheckChildren((Speech)childNode, workingNode)); } else if (childNode.GetType() == typeof(DialogSeed)) { returnList.Add(childNode); } } return(returnList); }
private List <AbstractNode> ConnectNodeChilds(AbstractNode node) { List <AbstractNode> returnList = new List <AbstractNode>(); List <string> childList = node.GetChildNodes(); foreach (string childUniqueID in childList) { AbstractNode childNode = db.GetNodeByUniqueID(childUniqueID); returnList.Add(childNode); if (childNode.GetType() == typeof(Speech)) { returnList.AddRange(ConnectNodeChilds(childNode)); } } return(returnList); }