Tag: extension methods

  • Fading Sprites in Unity

    Fading Sprites in Unity

    This tutorial shows how to extend the class SpriteRenderer  to support intuitive, painless fading transitions. Despite referring to sprites, this approach can be used to easily animate any property of a game object in Unity. The link for the script used in this tutorial is at the end of the post.

  • Extension methods in C#

    Extension methods in C#

    Following the heritage of C++, C# comes with a number of powerful features which can either be used to massively improve your code …or to make it completely unreadable. In this post we’ll discuss a technique to add new methods to already existing classes. Yes, even classes you don’t have access to such as Vector3, Rigidbody and even string. Let’s introduce extension methods with…