currentlyl I’m loading a csv into an array. I want to be able to search it for a string so I think I should use a generic dictionary as it will be faster - the array is quite large.
My current code is:
var wordCSV : TextAsset;
function Start ()
{
//Load Dictionary
var wordList = wordCSV.text.Split(";"[0]);
}
function FindWord(word : String)
{
for(int i = 0; i < array.Length; i++)
{
if(array*.name == word)*
- {*
-
print("I am element number " + i );*
- }*
- }*
}
How can I do the same with a Generic Dictionary?