Book Image

Mastering Unity 5.x

By : Alan Thorn
Book Image

Mastering Unity 5.x

By: Alan Thorn

Overview of this book

Mastering Unity 5.x is for developers wishing to optimize the features of Unity 5.x. With an in-depth focus on a practical project, learn all about Unity architecture and impressive animation techniques. With this book, produce fun games with confidence.
Table of Contents (16 chapters)
Mastering Unity 5.x
Credits
About the Author
Acknowledgment
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Working with animation - creating the navigator


The animator is now created for the camera object, and the camera object itself is configured in a hierarchy that'll make our work organized and clean going forward. The object structure is Navigator > Player > Main Camera, as shown earlier in the screenshot in the section Animating the camera. Now it's time for us to define the core functionality for the main camera by scripting. Specifically, we'll create a new class, called Navigator. This will be responsible for moving the camera across its network of paths. To create a new script, right-click in the Project panel and choose Create | C# Script. Name this Navigator. Then, double-click the file, open it inside MonoDevelop or another associated code editor, such as Visual Studio or Microsoft Code. The auto-generated class template will appear as follows:

using UnityEngine; 
using System.Collections; 
 
public class Navigator : MonoBehaviour 
{ 
    // Use this for initialization 
   ...