Sorted Shop

One reader recently asked “how to make a shop that is capable of sorting items by various fields like cost, atk dmg, lvl requirement etc.”, so I decided to take a small detour and go ahead and provide a solution. In this lesson we will generate, view, sort, and buy items from a user interface.

Continue reading

Object Pooling

Object pooling is a relatively common practice in games. By reusing your GameObjects instead of destroying and recreating them you can save precious CPU cycles. It is easy to find a lot of free scripts and tutorials on the subject – even Unity has provided one in a Live Training session. Their presentation, while a great introduction, was not what I would consider production ready. In this post I’ll share my thoughts on their implementation as well as how I would improve upon it.

Continue reading

Intro to Source Control

Today I would like to talk about something which isn’t actually programming, but which every programmer should know – source control (also known as version or revision control). You will see this topic listed on most job listings as something you should be familiar with, but many hobbyists go far too long (sometimes waiting until getting hired into a big company) before realizing its many benefits. Source control can be extremely valuable even if you work solo on a project! Continue reading

Social Scripting Part 2

In Part 1 of this series we discussed several means by which Unity allows you to get your scripts talking back and forth between each other. That included direct references, their legacy and new message system, and their new event system as well.

In this post we will examine the options available to you as a language feature of C#, just in case you don’t want to rely on the options Unity provided. Although their event system is quite powerful and easy to use, keeping your events native will allow your code to be more easily reused in other projects or ported to other engines. I consider this part of the series intermediate level, and will expect you to have a working knowledge of C#. Continue reading