Extension Methods: Helpers for Types You Can’t Edit (in Unity / C#)

Isn’t it frustrating when you can’t edit a class to add a method you really need?

Maybe the class is built into your programming language or game engine, hidden away in a dll file, or buried in 3rd party code simply too risky to alter.  Whichever the case, editing the original class isn’t an option.

This article will take an in-depth look at the various solutions to this common problem. We’ll explore some advantages, limitations, common pitfalls and best practices associated with each approach, and take a detailed look at one option which often gets overlooked: extension methods.

Continue reading