unity serializefield

C#
//Shows the private variable in the Unity Inspector
[SerializeField]
private string name;
Source

Also in C#: