unity 坐标
- 作者: 砒霜凉拌粉丝
- 来源: 51数据库
- 2020-09-24
unity 设置坐标有2种方式
gameObject.transform.position = new Vector3(0, 0, 0);
设置坐标为世界坐标
gameObject.transform.localPosition = new Vector3(0, 0, 0);
设置坐标为相对于父物体的坐标
transform.getcomponent<这里写你要获取物体的组件>().depth = 层级值;
gameObject.transform.position = new Vector3(0, 0, 0);
设置坐标为世界坐标
gameObject.transform.localPosition = new Vector3(0, 0, 0);
设置坐标为相对于父物体的坐标
transform.getcomponent<这里写你要获取物体的组件>().depth = 层级值;
推荐阅读
