Controlling the game with a State Machine

Just like your daily routines, you follow certain patterns that are comfortable to you. Why is that? Probably because it's easy for you and they're etched in your brain; they're habits.

Whatever it is you do; sort your laundry, build a sandwich, wash the dishes, work with Unity, you will eventually develop a routine pattern that you'll follow and like. You can equally believe that you will establish a pattern for writing scripts, too. Right now, after reading this book, you may already have some idea of how you will write and add scripts to GameObjects. Maybe you're already quite proficient at everything in Unity except for the scripting part. All you may want is to write some scripts and attach them to ...

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.