public void ParseDialogueFromCSVPathList(string[] csvPathList) { if (csvPathList == null) { return; } foreach (string csvPath in csvPathList) { string csvText = FileUtility.GetFileText(csvPath); CSVFile csvFile = new CSVFile(csvText); int csvCount = csvFile.length; for (int i = 0; i < csvCount; i++) { string scene_id = csvFile.Get <string>(i, "Scene_ID"); DialogueComp gDialogueComp = ParseDialogueCSV(csvFile, i); cacheDialogueDict = UtilityMethod.EditDictionaryArray <DialogueComp>(cacheDialogueDict, scene_id, gDialogueComp); } } }
private DialogueComp ParseDialogueCSV(CSVFile csvFile, int i) { DialogueComp dialogueComp = new DialogueComp(); dialogueComp._id = csvFile.Get <string>(i, "ID"); dialogueComp.scene_id = csvFile.Get <string>(i, "Scene_ID"); dialogueComp.group_id = csvFile.Get <string>(i, "Group"); dialogueComp.type = csvFile.Get <string>(i, "Type"); dialogueComp.character_ids = csvFile.Get <string>(i, "Character"); dialogueComp.animation = csvFile.Get <string>(i, "Animation"); dialogueComp.constraint = csvFile.Get <string>(i, "Constraint"); dialogueComp.effect = csvFile.Get <string>(i, "Effect"); dialogueComp.mainValue = csvFile.Get <string>(i, "Main Value"); return(dialogueComp); }