blog games developers documentation portfolio gallery



The Texture2D class in Unity lacks convenient functions to manipulate the image. Of course you can use GetPixels and SetPixels, but it would be a lot easier if simply had functions to properly Scale, Crop and Rotate as well as change Hue, Saturation, Brightness, Luminance, Contrast and Colorize.

You can test these extra Texture2D methods if you run the Demo scene that is included. Or you can run the demo here.

You can obtain the Texture2D+ package in the Unity Asset Store

Make sure you include the line
	using Texture2DExtensions;
in your scripts

All new Texture2D methods will not return a new Texture2D, but instead affect the original. If you want to preserve your original texture, you should clone it first. Like this:

myTexture = (Texture2D)Texture2D.Instantiate(baseTexture);

follow us