26 lines
552 B
C#
26 lines
552 B
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
|
||
|
||
/// <summary>
|
||
/// ͨÓù¤¾ß½Å±¾Àà
|
||
/// </summary>
|
||
public static class SimpleTool
|
||
{
|
||
/// <summary>
|
||
/// Texture2DתSprite
|
||
/// </summary>
|
||
/// <param name="texture"></param>
|
||
/// <returns></returns>
|
||
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;
|
||
}
|
||
}
|