unity小功能2

1.获取切割后的图

2.加载图片(Texture)并转为sprite

Texture2D aa = (Texture2D)Resources.Load("FullScreenfild/ic_heng_touxiangda") as Texture2D;  
Sprite kk = Sprite.Create(aa, new Rect(0, 0, aa.width, aa.height), new Vector2(0.5f, 0.5f)); 
或
Resources.Load(hero_name, typeof(Sprite)) as Sprite;

  

你可能感兴趣的:(unity小功能2)