Undo and Redo in Unity

Redo and Undo action is everywhere, but how it’s done? In most cases, developers use the Command Design Pattern which we implemented in Unity last time. So how can we extend it with undo and redo action? Let’s find out! ?

Because we did a lot in the last post about the Command Design Pattern, we will use it as our base. If you didn’t see it yet, it’s a great time to do so! I can wait. ?

Ready? So let’s get into that!

There is a lot of places where undo and redo action can come handy. Maybe it’s not that popular in games, but almost every app has it!

Continue reading “Undo and Redo in Unity”

Implementing Command Design Pattern in Unity

Let’s get back to the design patterns for Unity!
Today let’s introduce Command Design Pattern! This design pattern is famous for its encapsulation of requests, which can be useful for many applications and often is used for handling user input, but it’s not the only use case.

Command Design Pattern

The idea behind this design pattern is to move requests to the objects which could be collected and be executed in the queue. You can think about them like Actions or Events but represented as objects.

Continue reading “Implementing Command Design Pattern in Unity”