Inspector overring array.

I have a script that initialises the first two members of an array:

public string[] texts = new string[] {"Text1", "Text2" };

However, they are overriden by the inspector when the game starts, since I have the array size set as 1. Is there a way to stop the inspector from overriding the members and array length without making the array private?

You can use the [HideInInspector] attribute to hide it from the Inspector, however it is still serialized. And if the array has been modified before, you need to reset it, this option is right next to the script name.

Or you can make it private. Then write a property plus get and set.