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

The Typer object


The WordList class supports the import and tokenization of a dictionary, generating an array of words on a line by line basis. The GetRandomWord function returns a randomly selected word from the dictionary and the CompareWord function determines whether a typed word matches the chosen one entirely, partially, or not at all. Having now created this class, we begin work here on the Typer class, which actually accepts typed input from the keyboard, processes that input and displays UI complements for player feedback. Let's start by creating an object hierarchy. Create a new, empty object at the scene origin to act as the topmost node for the Typer. Name the object Typer and then create a Canvas object as a child. The canvas contains all objects for the associated UI.

Creating a Typer object

As with previous canvas components, we'll configure it to support multiple resolutions with a scaling technique. Set the UI Scale Mode to Scale With Screen Size and specify a Reference...