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

Setting the ambient light in Unity


Another useful operation we'd like to teach you is how to set the ambient light in your Unity scene so you can quickly check the look of your materials in the game scene without configuring an actual light.

Getting ready

For this recipe, we just need a scene in Unity with a textured model in it.

How to do it...

  1. Create a new scene in Unity and drag textured model into the scene. Be sure no lights are available in the scene and that the model's material is set to Diffuse in the Inspector window. With these lighting conditions, the model should look quite dark.

  2. From the main menu, navigate to Edit | RenderSettings.

  3. Now move to Inspector. Here, we can set several options for our ambient light. The one we are interested in here is the ambient light color.

  4. By default, Ambient Light is set to a dark gray. Click on the Ambient Light panel to open the Color panel, as shown in the following screenshot:

  5. Move the cursor to the white portion (the upper-right corner highlighted...