public override void InstallNode(GameObject workingNode) { AC.Conversation conversation = workingNode.GetComponent <AC.Conversation>(); if (conversation.options == null) { conversation.options = new List <AC.ButtonDialog>(); } int[] keyList = new int[1] { conversation.options.Count }; AC.ButtonDialog newButtonDialog = new AC.ButtonDialog(keyList); newButtonDialog.label = DialogText; newButtonDialog.isOn = true; // By default all conversation options will stop newButtonDialog.conversationAction = AC.ConversationAction.Stop; conversation.options.Add(newButtonDialog); // 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); // Adds the node unique id to be able to work with them in the next step. parentSeed.OrderedOptionUniqueIDs.Add(UniqueID); }
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); } } }