Failed to resize array in Inspector variable in Unity?

From what I read, this is how the "Size" vector is set

public Color[] teamAColors = new Color[4];

But when the code runs, it looks like this: enter image description here

It does not seem to matter what number I put for [4], the size always remains 6. I'm not sure where the number 6 even comes from the fact that I did not set anything for this number.

I even tried

 public Color[] teamAColors;

And then let my array automatically fill the length, but that doesn't change either.

+3
source share
2 answers

It's simple

 public Color[] teamAColors;

But what about this value of “6,” which “will not disappear”?

BUT YOU ARE INSTALLED ON THE "RESET" GOCHA IN ONE!

enter image description here

...

public Color[] teste;

?

enter image description here

, . , .

:

"" .

, Unity "" , .

reset "" . reset.

Cog.

enter image description here

:

, -, !

public float x;  // do this

public float x=2f;  // generally NEVER DO THIS

, . ...

[Header("How good is this?")]
public float x;

! !

[Range(2f,4f)]
public float x;
+5

"Reset" . reset , .

, !

+3

All Articles