using System.Collections;
using System.Collections.Generic;
using UnityEngine;
///
/// 通用工具脚本类
///
public static class SimpleTool
{
///
/// Texture2D转Sprite
///
///
///
public static Sprite Texture2Spr(Texture2D texture)
{
Sprite sprite = Sprite.Create(
texture,
new Rect(0, 0, texture.width, texture.height),
new Vector2(0.5f, 0.5f)
);
return sprite;
}
}