Hi! I have simple C# Dictionary variable, which holds 2D textures. At some point, I loop through it:
IDictionaryEnumerator en = conversants_tex.GetEnumerator();
while (en.MoveNext())
{
Now, here I check if Dictionary texture is null?
Debug.Log(“Null?”+conversants_tex[en.Key.ToString()]);
if (conversants_tex[en.Key.ToString()] != null)
{
Debug.Log(“YES!”);
… …
When dictionary has 2 different entries, I get this output:
Null?2D ObjectTexture
YES!
Null?2D ObjectTexture
Which is absolutely WRONG!!!
Both objects, before IF statement, are CLEARLY not NULL. Still, only first one passes the check.
I just can wrap my head around it - WHY??!!
I tried using foreach statement, it is the same.
Please, help!
There are no breaks in function, no returns, nothing to keep it from working normally…