Array won't update (even when change manually)

I add an array with 10 string values manually. I test the game. Array length returned is 10. So far so good. I remove two strings from my array. My array now has 8 values in it. I test the game. Array length returned is 10. Huh? Am I missing something basic here? It seems like the number of values is frozen in time, based on the first time I tested the game.

Here is my code:

using UnityEngine;
using System.Collections;

public class Database : MonoBehaviour 

	public string[] namesTerrain = new string[] 
	void Awake()
		print (namesTerrain.Length);

When you declare a variable public, what is in the inspector trumps all. Your initialization will be the default initialization for the variable as it is attached to an object, but after you attach it to an object, changes to the default initialization will be ignored.

You can “solve” this in a couple of different ways. You can go to the game object this script is attached. Next to the script there will be a gear with a down arrow. Select reset. This will force the code to reinitialize.

Another solution is to make the array private.