Skip to content

Instantly share code, notes, and snippets.

View SERGZV's full-sized avatar
💭
Working on portfolio

Sergey Zavyalov SERGZV

💭
Working on portfolio
View GitHub Profile
@nnm-t
nnm-t / ConvertToSprite.cs
Last active February 2, 2025 16:28
Convert Texture2D To Sprite
using UnityEngine;
public static class ConvertToSpriteExtensiton
{
public static Sprite ConvertToSprite(this Texture2D texture)
{
return Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
}
}