Home » Month: October 2016

The Wrong Null!

tl;dr: You can check whether a Unity.Object (including Component, GameObject, MonoBehaviour, etc.) is null using if (variableName), because it has an implicit bool operator that checks != null. If you’re trying to expose generic-typed properties in the inspector, you should constrain them with where T : Component or similar, or strange things may happen when Continue Reading