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 audio clips


Audio in Unity is managed according to the same easy philosophy that is applied to importing and managing graphics. The most common audio formats such as MPEG, WAV, AIFF, and MP3 are supported, and once imported, audio clips can be easily configured in the Inspector panel.

With regard to the file format, the general rule is to use large WAV files for background music and small MP3 files for sound effects.

The compression setting is the other basic configuration of an audio clip in Unity, as Unity allows audio clips to be set as Native or Compressed. By setting a clip as Native, we ensure that the clip won't need to be decoded at runtime. The file will be larger, but it sounds nicer and won't slow down the application once it gets played. The native setting is recommended for short sound effects that are usually imported as MP3 files, and thus not recompressed once they get imported in Unity.

Setting a clip as Compressed results in a smaller project file, but that file...