O'Reilly logo

Mastering Unity 5.x by Alan Thorn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Progressing with the Typer class

The Typer object (the root object) will be associated with a new class, defining its functionality. This class (the Typer class) will accept keyboard input and link that to a combat mechanic. We haven't yet developed any enemies to fight (like zombies), but this will be dealt with in forthcoming chapters. Consequently, we'll have reason to return to the Typer class later. As it stands, we can still link player input to important functionality already in place, such as UI animations and sound effects too. Let's begin with a new, empty class, as follows:

using System.Collections; 
 
public class Typer: MonoBehaviour  
{ 
} 

The first step in developing the Typer class is to build an extensible event framework. Events are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required