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 (such as zombies), but this will be dealt with in the forthcoming chapters. Consequently, we'll have a 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. 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.

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.