Public variable hidden in the inspector

Is there a way to see this variable in the inspector? e.g:

 public string pigName { 
    get {
       this.gameObject.name;
    } 
 }

I want to see the variable in the inspector for debug purposes and I don’t want to change the inspector to debug mode all the time. Someone can help me ?

I believe that you can place [SerializeField] above the code like this:

[SerializeField]
  public string pigName { 
     get {
        this.gameObject.name;
     } 
  }

You can’t

Source1

Source2

But you can set a Label Icon to a GameObject so you can see it’s name in the scene view at all times