Comments

  • The CurrentNode variable is an integer representing the progress of the camera through the animator graph and through the scene. It corresponds directly to the NavState parameter.
  • The NavigatorButton variable maintains a reference to the UI button on the canvas. This reference is retrieved in the Awake function using the FindGameObjectWithTag method. Thus, the UI navigator button is required to have an appropriate tag.
  • The Next and Prev methods are responsible for incrementing and decrementing the CurrentNode variable and then for updating the NavState parameter in the graph. Once updated, Mecanim automatically fires any relevant nodes in the graph.

Select the canvas button object in the scene and, from the object Inspector, scroll ...

Get Mastering Unity 2017 Game Development with C# - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.