RIngleton – a resource Singleton!

NOTE: You should probably use ScriptableObjects instead.

The ringleton is a design pattern I’ve been (ab)using quite a lot recently. It’s a really handy way of serializing / deserializing data that is used across your game.

Basically, what I needed was a quick and simple way of storing some data which is then used on multiple locations in my game. In bigger games you would probably use some form of custom json serializatian but that seemed a bit much for my needs.

This is what I came up with.
Continue reading “RIngleton – a resource Singleton!”

Asynchronous texture loading in Unity

Most of the time, Unity is great, but sometimes, you have to get your hands dirty. And this is the case with texture loading. Sure, it works great, if you’re using the built-in system, but that’s not possible in some cases.

Imagine this scenario: You’re making a 2D game, that has, say, 15 levels, and each level has a background. Since you’re making your game for mobile devices you want to keep your game as compact as possible. 10 levels in you’re pretty happy with yourself, the install file is roughly 20mb and that seems reasonable. But you notice that once you install your game on an iPad it suddenly becomes 600mb and that just won’t work.

So what’s going on here?
Continue reading “Asynchronous texture loading in Unity”