Transform
- childCount
- DetachChildren
- eulerAngles
- Find
- forward
- InverseTransformDirection
- InverseTransformPoint
- IsChildOf
- localEulerAngles
- localPosition
- localRotation
- localScale
- localToWorldMatrix
- LookAt
- lossyScale
- parent
- position
- right
- root
- RotateAround
- Rotate
- rotation
- TransformDirection
- TransformPoint
- Translate
- up
- worldToLocalMatrix
Transform.DetachChildren 分离子物体
function DetachChildren () : void
Description描述
Unparents all children.
所有子物体解除父子关系。
Useful if you want to destroy the root of a hierarchy without destroying the children.
如果你想销毁层级的根,而不销毁子物体是很有用的。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public void Awake() {
transform.DetachChildren();
Destroy(gameObject);
}
}
transform.DetachChildren();
Destroy(gameObject);
See Also: Transform.parent to detach/change the parent of a single transform
参见: Transform.parent 去分类/改变单个变换的父级。
最后修改:2010年12月19日 Sunday 17:35