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 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 virtual void ProcessNode(AbstractNode node) { Transform parentTransform = FindParentTransform(); GameObject newObject = MakeGameObject(node.UniqueID, parentTransform); node.InstallNode(newObject); foreach (string childUniqueID in node.GetChildNodes()) { ProcessNode(db.GetNodeByUniqueID(childUniqueID)); } }
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); }