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

Importing textures and setting them to Inspector


Importing textures into a Unity project is a fundamental activity, and you will perform it several times. The following recipe explains two ways to import textures into Unity and how to configure them for the materials of your 3D models.

Getting ready

For this recipe, you need any square texture that you may already have, or use the one we provide. Anything will do, even a simple, checker texture; there are many available online. We use the following image for this recipe:

How to do it...

To import a texture in Unity, we begin with opening it into a 2D editor:

  1. Open a PSD texture with Photoshop, or the alternative BMP file with any software you like. If you don't have the required software, you can download XnView, which can read PSD files. It is available at http://www.xnview.com/.

  2. Name the file. We picked the name firstTexture.

  3. Select the Assets/Textures destination folder in your Unity project.

  4. Save the file. You can either leave it in its PSD original...