unity 隐藏某个对象

1.设置坐标,将坐标设置到屏幕外(LocalPosition = new Vector3(10000, 0, 0))

2.设置Layer,原理是相机会剔除指定的层级,相机Camera的Culling Mask

3.render.enable

4.设置透明度(ngui的panel,ugui的CanvasGroup)

5.设置缩放,直接设置成0

6.直接删除不需要的对象:Destory

posted @ 2019-12-04 14:08  柯腾_wjf  阅读(678)  评论(0编辑  收藏  举报