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 ...