Sprite精灵图片
public class L3 : MonoBehaviour
{
public UISprite sprite;
// Start is called before the first frame update
void Start()
{
//Sprite作用
//NGUI中所有中小尺寸图片都用Sprite显示
//用它来显示图集中的单个图片资源
//可以理解为一个图片控件
//Sprite中的参数
//Type - Simple 缩放会拉伸
//Sliced - 这个模式要搭配Sprite设置里的Border使用
//Widget
//Pivot-控制对象的中心点
//Depth 决定渲染顺序
//代码设置图片
//改变为当前图集里面别的图片
sprite.spriteName = "bk";
//改变为另一个图集中的图片
NGUIAtlas atlas = Resources.Load<NGUIAtlas>("Atlas/login");
sprite.spriteName = "bkb";
}
}

浙公网安备 33010602011771号