Serialize Properties In Unity

Serialize Properties In Unity

Serialize properties in Unity easily. This wasn’t possible until about a year ago and has quietly slipped under the radar as far as I can tell. I was extremely surprised to find this nugget in a Unity forum where a request was made and several years later the concept works. Without using auto-properties this cut from 6-7 lines to 2 lines. It is so clean and is a new favorite feature.

Serialize Properties In Unity

Serialize a Dictionary in Unity

I like simple, and I like for Unity to handle as much of it as possible. To that end, are two solutions here. First, to just create a class or struct as a data container and make a List of that class or struct, or secondly, to implement your own dictionary that includes the inspectable bits. Where this becomes a better solution is that this new class can hold all the data you want and as long as the types can be serialized individually by Unity and is the same usage as a normal dictionary, then it will all be displayed in the inspector. I’ll provide examples below.

Frame Rate Respecting Object Pooling

Frame Rate Respecting Object Pooling

Object pooling was one of my first systems that I pieced together fragments and tutorials of, converted into visual script, and started making my own changes. One of the first things I did was to make pathways; where objects were created one object per frame or one batch of objects per frame. This also included an interlock to check if the frame rate was below a threshold.

Welcome To Building Blocks!

Welcome To Building Blocks!

I set out to make a game and, like probably everyone, you realize a system or manager of some type is needed for really everything you want to do if you want it to work right and not be tweaking on it all the time. I used visual scripting to get the ideas down…