Michele Mantovan

Unity Texture2D Extension

Recently I had to work on Unity with Texture2D taken from a camera and for some reasons they came out flipped in strange ways. So, I had the need to rotate or flip the textures and I realized that Unity doesn’t have this function ready to use.

This is Texture2DExtensions (source code). As the name suggest, is a little tool made for resizing, cropping, mirroring and flipping Unity’s Texture2D. It uses basics algorithms to iterate through the textures and set the right pixels.

You can use it right away into your projects to manipulate any Texture2D you want 🙂 Keep in mind though that It’s a little heavy computationally speaking so, don’t use it to manipulate in the update cycle.

Source code