Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with Unity 5.x 2D Game Development

You're reading from   Getting Started with Unity 5.x 2D Game Development Enter the world of 2D Game development with Unity 5.x

Arrow left icon
Product type Paperback
Published in Feb 2017
Publisher Packt
ISBN-13 9781784397173
Length 478 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Francesco Sapio Francesco Sapio
Author Profile Icon Francesco Sapio
Francesco Sapio
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. A Flat World in Unity FREE CHAPTER 2. Baking Cupcake Towers 3. Communicating with the Player – the User Interface 4. No Longer Alone – Sweet-Toothed Pandas Strike 5. The Secret Ingredient Is a Dash of Physics 6. Through a Sea of Sprinkles – Navigation in Artificial Intelligence 7. Trading Cupcakes and the Ultimate Battle for the Cake – Gameplay Programming 8. What Is beyond the Cake?

A 2D world

There are few things to notice in our project when it is set to 2D mode, which we are going to explore in this section.

First of all, if you ever need to switch between 2D and 3D mode, you can do so by navigating to Edit | Project Settings | Editor. If you go in to the Default Behavior Mode settings, you can change the Mode, as shown in the following screenshot:

A 2D world

Coming back to our main interface, let's see the main differences between 2D and 3D mode. The Scene view is set by default to 2D, as you can see in the following screenshot:

A 2D world

This allows us to have the Scene view locked on to the xy plane.

Note

The z axis is used to determine which object should be rendered first. This decides which objects are in the foreground and which ones are in the background.

Then, every time we create a new scene, the default camera that comes with it is always set in Orthographic mode. Furthermore, its position is set to (0, 0, -10), whereas in 3D mode, it is set to (0, 1, -10). You can also check this by selecting the Main Camera in the Hierarchy panel and seeing its properties in the Inspector, as shown in the following screenshot:

A 2D world

Other differences are the options to use the Sprite Packer or the default objects that don't have real-time directional lights. There are also changes in the Lighting settings (you can access them from Window/Lighting). In particular, the Skybox is disabled for new scenes and Precomputed Realtime GI, Baked GI, and Auto-Building are set to off. In addition, the Ambient Source comes with a dark grey color.

In the following screenshot, you can see the default Lighting settings:

A 2D world

Note

The RGB code of the color of the Ambient Source that is set by default in the 2D mode is (54, 58, 66).

However, the most important difference is how Unity imports new 2D assets, but we are going to see this in detail in the following sections.

You have been reading a chapter from
Getting Started with Unity 5.x 2D Game Development
Published in: Feb 2017
Publisher: Packt
ISBN-13: 9781784397173
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime