The Unity documentation it indicates that all public variables are made available in the inspector for direct editing. While this is handy, it is also dangerous. This article will cover a few things regarding public variables, and how to avoid them in Unity.
Tag Archive for C#
Particular Problems with Public Variables in Unity
Category: Coding, Napkin Western, Tips and Tricks, Unity |
Tags: Access Modifiers, Bugs, C#, Code, Coding, Debugging, Fixes, Good Practice, Information, Inspector, Know-How, Programming, Tips, Unity, Variables
The Case for C# in Unity
I would like to take this post to explain why using C# in Unity is a better idea than Javascript. If you end up not needing multiple returns for functions, non-type-specific logic, or are okay with the wonky auto-completion for Javascript, then that is okay. On the other hand, if you want to take advantage of those features, and more read on.