Null Check and Equality in Unity

In some programming languages – like C# – it is a common practice to use comparison operators and functions to check for null references. However, when programming in Unity, there are some particularities to keep in mind that the usual C# programmer usually does not take into consideration. This article is a guide on howContinue reading “Null Check and Equality in Unity”

Unity’s Scripting Duality and Object Destruction

The Unity engine provides users with tools and abstractions that ease its usage and hide its complexity. Although we often take these commodities for granted and completely forget they exist, we often face a situation in which they become apparent, usually due to an unexpected behaviour. In this article, I discuss how an example ofContinue reading “Unity’s Scripting Duality and Object Destruction”

C#’s Finalizer/Destructor Trap

Let’s talk about C#’s finalizers (also called destructors in C#) and how a common mistake when using them might lead to unwanted behaviour, especially in applications made with the Unity engine. Finalizers A finalizer is a method that is called whenever an instance of a class is being garbage-collected. It is used for cleanup, commonlyContinue reading “C#’s Finalizer/Destructor Trap”