i am adding a text file in dictionary but it is giving error
NullReferenceException: Object reference not set to an instance of an object
original File
aa
aah
aahed
aahing
aahs
aal
aalii
aaliis
aals
Code:
import System.Collections.Generic;
import System.Linq;
var MytextAsset:TextAsset;
var myDictionary :Dictionary.<String,String>;
function Start () {
/* split the text file up by newline characters */
var textLines : String [] = MytextAsset.text.Split("/rn"[0]);
myDictionary.Add(textLines[0], textLines[0]);
}
the error is in last line…