Building AR game with AR Foundation in Unity

Updated on Sep. 2019 – Updating examples to AR Foundation 2.0+

I ❤️ Unity for what they are doing for the game industry. With the introduction of ARKit for iOS and ARCode for Android, it was just a matter of time when Unity would unify both technologies under one thing. And I was right!

Introducing AR Foundation in Unity! ?

On last GDC they presented a great demo of what AR is currently capable of. And if you are hyped about this tech as I am, you might ask how you can build that?

In the beginning, I was a little bit skeptical if it will work as it’s still in preview, but with building my little project, I found out that it’s much simpler than anything else! ?

Continue reading “Building AR game with AR Foundation in Unity”

Localizing your game in Unity

Nowadays it’s rare to create games with only one language available for a player. So today we will tackle localizing games in Unity using Singleton Design Pattern and Data Serialization.

Why should I care?

I know that we are living in a world where the English language becomes a standard mean of communication, but there are still people that don’t speak English! So the only way to get to them is to make a game available in their native language.

Continue reading “Localizing your game in Unity”

Data Serialization in Unity (JSON friendly)

As programming is all about what you are doing with data, I thought that it would be a good idea to speak about data serialization in Unity. Especially that now we can turn data objects into JSON with JsonUtility! ❤️

What is so special about that?

Data serialization is essential for games for a variety of reasons. Saving and loading player progress or saves, sending and receiving data from a server, and in general converting data to and from a text or files. ?

Continue reading “Data Serialization in Unity (JSON friendly)”

Singleton in Unity – Love or hate?

Those who know me, know that I have a rough relationship with the Singleton Design Pattern. Mostly I don’t like using it very often or even at all. This approach has a lot of benefits, starting with cleaner code architecture, less coupling, and in general fewer problems. ?

When to use it?

So when you would implement singleton? When you would like to have only one instance of a specific object. Example of what could be a custom resource manager where you store or load files that you downloaded from the web or any other data storage.

Continue reading “Singleton in Unity – Love or hate?”

How to implement Object Pooling in Unity

Object pooling is one of the easiest forms of optimization in Unity. Just recently we implemented the Factory Design Pattern which is related to today’s subject.

Object Pooling?

Let’s begin by explaining what Object Pooling is. So this is an optimization practice which is based on instance reusability. In Factory, we created a new instance of prefab, and later we destroyed it which is not an issue when we want to create just a few instances.

Problems start arriving when we create a lot of new instances, for example when shooting bullets from a gun, or we spawn a lot of special effects.

Continue reading “How to implement Object Pooling in Unity”