Game Development Reference
In-Depth Information
Criticism 2: Code comments are pointless. I don't want to read a novel.
They just get in the way and make things even more confusing. Far from
being helpful, they can steer us in the wrong direction. Good code speaks
for itself and doesn't need commenting!
Response: There's something true in this: code comments should be
helpful. But, if they're poorly written and needlessly lengthy, they do stand to
be more of an obstacle than a help. However, this danger needn't prevent us
from using code comments altogether. It just reminds us to be careful and
concise in our commenting, keeping them relevant and informative. So keep
comments as short as possible and stick to the point.
Note Code commenting need not be restricted to just standard, official comments.
Commenting can be extended into your very coding style. By using meaningful function,
variable, and class names, you can make your code a lot clearer and easier to work with.
Tip #4: Show Project Wizard on Start-up
At start-up, Unity will, by default, always open the most recently used project if there's one to
open; otherwise, it'll display the Project Wizard to create a new project. Its decision to open the
most recent project first is usually a convenient feature that you'll leave unchanged. But there are
times when this behavior can be problematic. If you're working in a team and are using Unity in a
networked environment, it's likely you've opened a project from a shared network drive. In itself,
doing that will not generally cause any major issues. However, Unity expects to open projects
on an exclusive basis—meaning that only one instance of the project may be open at a time.
Consequently, if you restart Unity and it seeks to reopen the shared project but finds it's already
open by another user on the network, it'll cancel the open operation altogether and will exit instead
of showing the Project Wizard. The result is that you'll be permanently locked out of Unity until the
other user on the network finally decides to close the project, allowing you exclusive access again.
Now, typically opening projects over networked drives is not something I'd recommend doing if
it can be easily avoided. But even so, there's a way around this specific problem: specifically, by
forcing Unity to always show the Project Wizard on start-up, as opposed to opening the most recent
project. To achieve this, simply choose Edit Preferences from the Editor main menu. Then from
the General tab, enable the feature Always Show Project Wizard (see Figure 1-22 ).
 
Search WWH ::




Custom Search