Book Image

Unity 4.x Cookbook

By : Matt Smith, Chico Queiroz
Book Image

Unity 4.x Cookbook

By: Matt Smith, Chico Queiroz

Overview of this book

<p>Covering the latest version (Unity 4) of this established game engine, the Unity 4.x Cookbook explores a wide range of 3D, animation, multimedia, and scripting game features.<br /><br />The power of Unity 4 is demonstrated through the 10 chapters covering many of this game engine’s features.<br /><br />"Unity 4.x Cookbook" helps you learn how to make the most of the powerful but easy-to-use Unity 4 game engine. <br /><br />Every Unity game developer is different. Some come from a multimedia background, some are new to game development, and some are transferring from other engines. Whatever your background, with the breadth and depth of topics covered you should find new features and techniques to enhance your next game.<br /><br />This book offers detailed, easy-to-follow, step-by-step recipes helping you master a wide range of Unity game features. <br /><br />Chapters are provided focusing on the basics; audio, cameras, images, materials and animations, GUIs, external resources and devices, directional and artificial intelligence character control, and performance optimization.<br /><br />"Unity 4.x Cookbook" provides a collection of ideas and resources that should offer new and useful techniques for every Unity game developer to enhance their next game.</p>
Table of Contents (18 chapters)
Unity 4.x Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Creating transparency texture maps


If you want your player to partially see through an object, you'll need a transparent or semi-transparent material. Plastic film, cutouts, and grids are some of the artifacts you can produce with transparent texture maps.

Getting ready

For this recipe, we will create a material simulating a slide film. The main reason behind this choice is because this material will allows us to use full transparency to make rounded borders of the frame, and also use semi-transparency to illustrate the film itself. For the rest of this recipe, it is assumed you are capable of creating, using your image editor, an image like the one intended (basically, a beveled round-cornered rectangle containing a picture within). If not, please feel free to use the one included inside the 0423_03_04 folder.

How to do it...

To create a transparent material, follow these steps:

  1. Create a new material named slideMaterial.

  2. Select your material. In the Inspector view, under the material's name,...