Object.operator bool 布尔运算
static implicit function bool (exists : Object) : bool
Description描述
Does the object exist?
物体是否存在?
// check if there is a rigidbody attached to this transform
//检查物体是否添加了刚体?
if (rigidbody)
Debug.Log("Rigidbody attached to this transform");
is the same as
等同于
// another way to check if a rigidbody is attached to this transform
//另一种方检查物体是否添加了刚体?
if (rigidbody != null)
Debug.Log("Rigidbody attached to this transform");
最后修改:2010年12月8日 Wednesday 18:47