I'm having issues dealing with a dictionary that I want to use to keep track of what dialog has been said.
In both cases, the key doesn't exist in the dictionary. When I do this, things are fine.
But when I do this, I get constant NullReferenceExceptions:
Any idea why?
Your dictionary should be a member of the class.
Basically the rest as you've got it should be fine from what I can see.
answered Feb 16, 2014 at 10:20 PM
Ah thanks. Looks like the problem was that I was declaring the dictionary as a class member, and then in Start(), redeclaring it with "Dictionary saidDialogs = new Dictionary();"
Once I removed that "Dictionary" from the second part, things started working.
Thanks so much for all the help!