From 93b5f588e3cb644f61e002932d61f2c6cdab87ab Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 11 Oct 2019 18:16:34 -0400 Subject: We finally got rid of GPL --- Assets/Scripts/Localisation/CSVLoader.cs | 68 -------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 Assets/Scripts/Localisation/CSVLoader.cs (limited to 'Assets/Scripts/Localisation/CSVLoader.cs') diff --git a/Assets/Scripts/Localisation/CSVLoader.cs b/Assets/Scripts/Localisation/CSVLoader.cs deleted file mode 100644 index 6805761..0000000 --- a/Assets/Scripts/Localisation/CSVLoader.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text.RegularExpressions; -using UnityEngine; - -public class CSVLoader -{ - //Reference file; - private TextAsset csvFile; - private char lineSeperator = '\n'; - private char surrond = '"'; - private string[] fieldSeperator = { "\", \"" }; - - public void LoadCSV() - { - csvFile = Resources.Load("localisation"); - } - - public Dictionary GetDictionaryValues(string attributeID) - { - Dictionary dictionary = new Dictionary(); - - string[] lines = csvFile.text.Split(lineSeperator); - - int attributeIndex = -1; - - string[] headers = lines[0].Split(fieldSeperator, StringSplitOptions.None); - - for(int i=0; i attributeIndex) - { - var key = fields[0]; - - if (dictionary.ContainsKey(key)) { continue; } - - var value = fields[attributeIndex]; - - dictionary.Add(key, value); - } - } - - return dictionary; - } - -} -- cgit v1.2.3