Collection of texture functions.

namespace Sirenix.Utilities.Editor
public static class TextureUtilities


Namespace: Sirenix.Utilities.Editor
Assembly: Sirenix.OdinInspector

Static Methods

Return Type Definition Description
Texture2D ConvertSpriteToTexture(Sprite) Converts a Sprite to a Texture2D.
Texture2D LoadImage(int, int, byte[]) Loads an image from bytes with the specified width and height. Use this instead of someTexture.LoadImage() if you're compiling to an assembly. Unity has moved the method in 2017, and Unity's assembly updater is not able to fix it for you. This searches for a prober LoadImage method in multiple locations, and also handles type name conflicts.

Extension Methods

Return Type Definition Description
Texture2D CropTexture(this Texture, Rect) Crops a Texture2D into a new Texture2D.