Read Only Attribute

ReadOnly is used on any property, and disabled the property from being changed in the inspector. Use this for when you want to see the value of a property in the inspector, but don't want it to be changed.

[ReadOnly]
public string MyString = "This is displayed as text";

[ReadOnly]
public int MyInt = 9001;

[ReadOnly]
public int[] MyIntList = new int[] { 1, 2, 3, 4, 5, 6, 7, };