B、Transform类实例方法
1、DetachChildren:分离物体层级关系
public void DetachChildren();
此方法的功能是使GameObject对象的所有子物体和自身分离层级关系
2、GetChild:获取GameObject对象子类
public Transform GetChild(int index);
index为子物体索引值
此方法用于返回transform的索引值为index的子类Transform实例
参数index的值要小于transform的childCount值
3、InverseTransformDirection:坐标系转换
public Vector3 InverseTransformDirection( Vector3 direction );
public Vector3

本文介绍了Unity中Transform类的13个实例方法,包括分离子物体、获取子物体、坐标转换、判断子物体关系、物体朝向、绕轴旋转、绕点旋转等,详细解释了每个方法的功能和参数含义,帮助初学者理解Unity中的对象层级和空间变换操作。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



