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

Configuring transparency


It is very common to have images that display transparency to add details and improve the look of 3D models. PNG files store the information regarding the alpha channel of an image, so that parts of the image itself can be displayed as transparent. The following recipe shows you how to configure a transparent texture in Unity.

Getting ready

For this recipe, we use another image we have provided, the one named secondTexture. As this image is already saved in PNG format, we jump straight into Unity and import it from there.

How to do it...

  1. From the Project panel in Unity, select the Assets/Textures folder.

  2. Right-click anywhere and select Import New Assets, as shown in the following screenshot:

  3. Select the secondTexture image to upload it into Unity. Actually, Unity is flexible enough that you can even simply copy and paste assets from one folder to another.

  4. From the Inspector window, check that the texture settings are defined as in the following screenshot:

  5. Click on Apply...