Unity Transform

来源:互联网 发布:php可以写后端吗 编辑:程序博客网 时间:2024/03/28 22:03
int i=0;
// Use this for initialization
void Start () {
foreach (Transform child in transform) {
child.position += Vector3.up * 8*(++i);
}

}

--------------------------

Transform support enumerators so you can loop through children ,只能获取一级子对象,不能递归;

如果子对象或父对象经过旋转,要操作子对象可以使用transform.position,操作子对象的世界坐标。

原创粉丝点击