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

Playing videoclips in the scene


In the last recipe of this chapter, we'll learn how a video can be displayed in the game scene. It is a useful feature—very handy for computer graphics scenes or cut scenes or if you want to include a monitor displaying a video clip in your game scene.

Getting ready

You need two things for this recipe. Firstly, install QuickTime on your PC, if you don't have it already. Without QuickTime, Unity cannot import video clips properly. The QuickTime installer can be downloaded from http://www.apple.com/quicktime/download/.

Next, we need a video clip. If you don't have a clip to use, you can load the video clip we have provided with the content of this book.

How to do it...

  1. Exit and launch Unity again, after QuickTime is installed.

  2. Create a new folder in your project and name it Videos.

  3. Access the folder and right-click to import a new asset, as we did many times.

  4. Unity imports all major video file formats. In this case, we opted for an MPEG file. Select the file named video_01...