Private vs. Public in terms of performance?

Hi,

This is kind of a general programming question, but in my case, it’s in Unity.

I’m declaring some of my variables public, even though they could be private, just to test them in the Editor Window. Does this cause any problems in terms of memory / time?

Does converting them to private help any of these matters?

Thanks !

Nope. If you want them private for proper encapsulation but you still want to assign values via the Inspector simply add the [SerializeField()] attribute in the declaration.