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.root 根
var root : Transform
Description描述
Returns the topmost transform in the hierarchy.
返回层次最高的变换。
(This never returns null, if this Transform doesn't have a parent it returns itself.)
这从来不返回null,如果这个变换没有父级,将返回自身。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnCollisionEnter(Collision collision) {
if (collision.transform.root != transform.root)
print("The colliding objects are not in the same hierarchy");
}
}
// Is a collision between two objects in different hierarchies?
//碰撞的两个物体在不同的层次?
function OnCollisionEnter(collision : Collision) {
if ( collision.transform.root != transform.root ) {
print("The colliding objects are not in the same hierarchy");
}
}
最后修改:2010年12月19日 Sunday 0:27