Chapter 8, Developing the State Machine

Pop quiz – understanding State Machine operation

Q1

The State classes also inherit the IStateBase interface. This means every State object is also an IStateBase object, allowing the activeState variable to store any of the State objects.

Q2

The StateManager script has the Update() method and the OnGUI() method. The Update() method calls StateUpdate(), and OnGUI() calls ShowIt().

Q3

All GameObjects in the current Scene are destroyed.

Q4

Absolutely false. Adding States, removing States, and changing the order that the States can switch are a few of the greatest benefits of a State Machine.

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.