I would agree that we probably should be using properties more often than we do. Some of the reason for this is Unity’s poor handling of properties in the inspector. Properties simply don’t appear in the inspector. (That actually has changed, but only by using a special modifier field: before the SerializeField, but this still doesn’t work with custom code in the getters/setters).
In this case, a public getter could be done as a property or a method, since we’re simply exposing a getter. There are actually several ways this getter could be handled.
public int ExperiencePoints {get; private set}
This would require no backing field (the compiler creates a hidden backing field for you, but it would not appear in the inspector).
[field: SerializeField] public int ExperiencePoints (get; private set};
This would actually be shown in the inspector. If you want to use Editor code to display the property in your editor, however, you have to use the special name for the backing field. This feature was added in a relatively recent version of Unity.
void experiencePoints=0;
public int ExperiencePoints
{
get =>experiencePoints; //in this construction => experiencePoints is equal to {return experiencePoints;}
private set
{
ExperiencePoints=value;
}
}