public static void PopulateDictionary() { dialog = new Dialogue(); diagLines = File.ReadAllLines(pathDiaFile); SetStartAndEndPoint("Script"); for (int i = start; i <= end; i++) { if (lines[i].StartsWith("<")) { //GetText() gets the lines from the .kdialog file using the pointer from the .sce file. //lines[i].Split(':')[0] gets the pointer from the .sce file //lines[i].Split(':')[1].Trim() gets the next pointer for the next line of dialogue //lines[i].Split(':')[0].Trim() at the end gets its current pointer and it sets the scentence id dialog.dialogue.Add(new Sentence(GetText(lines[i].Split(':')[0]).Trim(), lines[i].Split(':')[1].Trim(), lines[i].Split(':')[0].Trim())); } if (lines[i].StartsWith("(")) { dialog.dialogue.Add(new Question(GetText(lines[i].Split(':')[0]).Split('@')[0].Trim(), GetAnswers(GetText(lines[i].Split(':')[0]).Trim()), GetNodes(lines[i].Split(':')[1].Trim()), lines[i].Split(':')[0].Trim())); } if (lines[i].Contains("[")) { if (lines[i].StartsWith("[START]")) { dialog.startID = lines[i].Split(':')[1].Trim(); } } } DialogueBuffer.Load(dialog); }
public void Update() { if (Input.GetKeyDown(KeyCode.Alpha1)) { DialogReader.InitScenario("MetalMilitia"); DialogueBuffer.PushFirst(); } if (Input.GetKeyDown(KeyCode.Alpha2)) { DialogReader.InitScenario("Scenario5"); DialogueBuffer.PushFirst(); } }