From where does the public variable names comes in inspector for TextMesh Pro?

Viewed 48

I am little confused from where does below names comes:

enter image description here

My script have below names without space. Does inspector adds space?

public TextMeshProUGUI countText;
public GameObject winTextObject;
1 Answers

Yup, Unity creates the Inspector label by introducing a space wherever a capital letter occurs in the variable name. It also removes leading underscore like _myVariable and also removes m_myVariable.

So to sum up:

myVeryImportantVariable  will be   My Very Important Variable
_myVeryImportantVariable  will be   My Very Important Variable
m_myVeryImportantVariable  will be   My Very Important Variable

Ofcourse whenever you need custom naming, like you want your variable name from code public bool isDead; to show up in the inspector like Dead do not hesitate to write a custom editor script.

Related