Posts Tagged finite state machine

DIY Iterators and Coroutines

Tags: , , ,

Iterators aren’t magic. We’ve seen the IL2CPP output for them and it’s not complex. It turns out we can just as easily implement our own iterators and gain some nice advantages along the way. Read on to learn how!

Read the rest of this article »

No Comments

A Simpler Finite State Machine (FSM)

Tags: , , ,

In my last article about Finite State Machines (FSM) for Unity, I showed a “pure code” way to create a state machine, states, and transitions between those states. It worked, but I wanted to create a simpler system. I’ll show you it today!

Read the rest of this article »

11 Comments

A Finite State Machine (FSM) for Unity

Tags: ,

Today’s article introduces a small but capable and extensible finite state machine (FSM) that you can use to organize your Unity applications’ code. FSMs are commonly used to represent the different modes the app can be in—main menu, world map, gameplay, game over—and how the app transitions from one state to another. The FSM in today’s article follows the pure code methodology by not tying the code to game objects, MonoBehaviours, or scenes. So read on to learn about and make use of this “pure code” FSM for Unity!

Read the rest of this article »

26 Comments