Chapter 7, Creating the Gameplay is Just a Part of the Game

Pop quiz – using a State Machine for game control

Q1

Helps keep code very organized.

Q2

A State Machine has a controller that is a Unity script, which is attached to a GameObject. The State Machine controller in this book is named StateManager, which calls the methods on a particular State.

Q3

There is no limit. Use as many as needed for controlling gameflow.

Q4

A C# interface specifies the methods each State has to implement.

Get Learning C# by Developing Games with Unity 3D Beginner's Guide 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.