Advanced programming techniques

As part of this chapter, we will start to go in depth with some advanced programming techniques. These enable us to structure our code better and add management to our game project, instead of just adding GameObjects to the scene.

Note

Some of the scripts created in the following sections will only be for example purposes and will not be implemented in our game. However, it is recommended that you follow along. Any scripts that will be needed for our game will be readdressed in the Adding NPCs and A Conversation System section.

Singletons and managers

Any project of a sufficient size and complexity is going to run into issues related to managing your GameObjects as and when they are added and removed from a scene. If ...

Get Mastering Unity 2D Game Development - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.