c# array size doesn't grow past 10 (bracket initialization)

I have a singleton script, that all it does is handle / process arrays of names of layers, and then calls Physics.IgnoreLayerCollision on specific ones from specific lists.

The problem is, inside my script i have this array:

private string[] noSelfCollisions = {
		"Team1",
		"Team2",
		"Team3",
		"Team4",
		"Team5",
		"Team6",
		"Team7",
		"Team8",
		"NPC",
		"RTSUnit",
		"Obstacles",
		"Grid",
		"Ground",
		"Selectable",
		"Default"
	};

And then the inspector (even before I hit play) only shows the array until “Obstacles” and it’s length as 10.

This is obviously wrong, and confuses me. The script has been recompiled, I have tried adding values and making the variable public, then private again (to force a recompile) but to no avail.

What could be causing this to happen? I’m confused to no end about this.

Something is messing with your array. Either you’re not printing the correct one, or noSelfCollisions’s value changes. Might be one of your scripts, or Unity (but the array was private to begin with, so it’s probably not the issue).
Initialize your array in Start or Awake, and print it right away, the values should be correct.

Try to find every affectation to this array in your code.

Unity saves your actions, including values of variables. Just rename your array. Save it. And rename at original name once again and save.

The user: agozharik86

This answer was correct. I thought changing values of the array would cause unity to retouch the array and compile it with new data, but you have to rename it. Something in it’s compiler was stuck and would not recompile this part of code.

So in all, the problem is fixed, and for future reference to anybody, rename variables when they “stop” changing to have unity recompile them.