Exemplo n.º 1
0
        // Populates the DialogueLibrary with new Dialogues from the CSV
        public static void ParseDialogues(string resourcePath)
        {
            List <List <string> > csv = ParseCSV(resourcePath);
            Dialogue acc = null;
            Dialogue builder;

            for (int i = csv.Count - 1; i >= 0; i--)            // LINE PARSING, in reverse for recursion
            {
                // Debug.Log("Line "+i+", # of Elems: " + csv[i].Count);
                builder = new Dialogue(csv[i][1], csv[i][2], csv[i][3], csv[i][4], csv[i][5].Split(' '), acc);
                // Debug.Log("New Line: " + builder.speaker + " : " + builder.body);
                if (csv[i][0] == "")
                {
                    acc = builder;
                }
                else
                {
                    //Debug.Log(csv[i][0]+" : "+builder);
                    DialogueLibrary.Add(csv[i][0], builder);
                    acc = null;
                }
            }
        }
Exemplo n.º 2
0
 void InitDialogueManager()
 {
     dialogueLibrary = new DialogueLibrary();
 }