Book Image

Unity 2D Game Development Cookbook

By : Claudio Scolastici
Book Image

Unity 2D Game Development Cookbook

By: Claudio Scolastici

Overview of this book

<p>Unity is a powerful game development engine that provides rich functionalities to create 2D and 3D games.</p> <p>Unity 2D Game Development Cookbook is a practical guide to creating games with Unity. The book aims to serve the purpose of exploring problematic concepts in Unity for 2D game development, offering over 50 recipes that are easy to understand and to implement, thanks to the step-by-step explanations and the custom assets provided. The practical recipes provided in the book show clearly and concisely how to do things right in Unity. By the end of this book, you'll be near "experts" when dealing with Unity. You will also understand how to resolve issues and be able to comfortably offer solutions for 2D game development.</p>
Table of Contents (15 chapters)
Unity 2D Game Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Setting up sprites


In this recipe, we explore the operations required to set up a 2D image as a Sprite type in Unity.

Getting ready

You can start an entirely new project for this chapter, or open the project we are already working on. In either case, add a new folder to the Assets directory of the project and name it Sprites. As we already did this operation in the previous chapters, we won't repeat the steps here.

How to do it...

  1. Import the 2D_Sprites package we have provided with the contents of this book to your project. If you don't remember how to do it, right-click on the Sprites folder you just created and select Import Package/Custom Package... from the menu, as shown in this screenshot:

  2. The package contains two images named 2D_pose and 2D_walk. Ensure that both are selected in the Import panel and then hit Import, as shown in the following screenshot:

  3. Once the importing process is complete, access the Sprites folder and select the first picture, 2D_pose.

  4. Go to the Inspector window and...