Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Mastering Unity 2D game development
  • Toc
  • feedback
Mastering Unity 2D game development

Mastering Unity 2D game development

By : Jackson
3.8 (21)
close
Mastering Unity 2D game development

Mastering Unity 2D game development

3.8 (21)
By: Jackson

Overview of this book

If you have C# knowledge but now want to become truly confident in creating fully functional 2D RPG games with Unity, then this book will show you everything you need to know.
Table of Contents (15 chapters)
close
Free Chapter
1
1. Overview
14
Index

Advanced programming techniques


As part of this chapter, we 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 game objects to the scene.

Singletons and managers

Any project of a sufficient size and complexity is going to run into issues related to managing your game objects as and when they are added and removed from a scene. If you don't get your design right from the start, you are setting yourself up for a world of mess later. A common way to handle this is to use one of the three patterns, single instance managers, singletons, or a dependency system, to manage these controllers for you.

There are two main ways through which you can implement the singleton pattern in Unity. The first way is to use a public static parameter within a class to maintain the runtime class. This also allows any other script to access it from anywhere in the game and is useful if you want other...

bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete