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 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.
Event Manager – A More Flexible Event Structure
I think this is a good idea? I used a visual scripting tool that used events in a similar way and I find it a natural way of thinking about events, while still using the standards for events, such as including the sender and an EventArgs derived data package. With the difference being…
Color Pick – Code generation strategy for a new tool
I wanted a friendly way to expand colors & functionality in Unity, not just how to type boiler plate code for yourself. After looking at code generation…
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!
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…