Simple Question: Does this work in any version of Unity so that I can edit this field in the Inspector?
[field: SerializeField]
public string FullName { get; private set; }
Thanks
Simple Question: Does this work in any version of Unity so that I can edit this field in the Inspector?
[field: SerializeField]
public string FullName { get; private set; }
Thanks
It does βworkβ in the sense that the field is editable in the inspector and serialized by Unity. The only problem is that the name shown in the inspector is not very pretty:
I have created an add-on for Unity that can display these with names matching the property name called Power Inspector. It can even handle arrays and such.
if you make your field public you can edit the field from editor.
if you want to make your field private but also want to edit your field from editor you must use [SerializeField] tag just before your perivate field.
public string yourPublicField;
[SerializeField]
private string yourPrivateField;