List Bug when using debugger

So I have a list of enemies that I instantiate via a loop. This successfully spawns an enemy, but only ever one. When I make the list I get ENData (null) when I set it to the levels enemy list (taken from another script) it becomes this:

EBData    Count=1
          Unknown type 'System.Collections.Generic.CollectionDebuggerView'1, mscorlib.dll'

Now when it goes into the loop I can view the variables inside by hovering my mouse over them, and the enemy is spawned correctly. If I go into the script the list is being called from and check it there I receive the same error.

Post some code, easier to help that way.

I had this bug before, I fixed it by making a new class file and copy the code in, but I'd like a better fix.

guess I'm bumping

OK, I ran a test and got the same error in the debugger as you. Then I saw this at [StackOverflow][1]. So, this would seem to be a bug in Mono, but should only affect you when using the debugger. In my test, I added several items to the list, then printed them out in Debug.Log and they were all there. So this bug should not affect your running game. [1]: http://stackoverflow.com/questions/14329222/unity-weird-debugging

That sucks, hopefully Unity will upgrade to mono 2.10 soon. It's an annoying bug.

1 Answer

1

Look for solution: Unable to populate System.Generic.Collections.List - Questions & Answers - Unity Discussions