Inspector - Public Data Variables

I’m still learning how to use Unity and overall really like it.

One thing about it doesn’t seem right, though - the Inspector encourages users to create public variables. This seems like bad OO practice and reeks of code smell. I suppose accessors might do the trick, or does Unity not allow for them? Hope I’m not beating a dead horse issue.

No it doesn’t. you can [Serialize] private vars and they will show up in the editor.

I suppose that’s a workaround, but it’s still not in the spirit of an object restricting accessibility to certain fields.

If you want to use things like properties, you have to roll your own inspector for the component at hand.

Extend the editor? Seems so. Might make for an interesting side project. Thanks for the input!