collider 碰撞器

2015-1-4 17:07| 发布者: 杨炎| 查看: 1409| 评论: 0|原作者: 蛮牛|来自: yzc88亚洲城脚本manual

摘要: collider 碰撞器inherits fromcomponenta base class of all colliders.所有碰撞器的基类。参见:boxcollider,spherecollider,capsulecollider,meshcollider,physicmaterial,rigidbody.if you intend to move the col ...

collider 碰撞

inherits fromcomponent

a base class of all colliders.

所有碰撞器的基类。

参见:boxcollider,spherecollider,capsulecollider,meshcollider,physicmaterial,rigidbody.

if you intend to move the collider around a lot it is recommended to also attach a kinematic rigidbody to it.

如果你打算经常移动这个刚体,建议再附加一个运动学刚体给它。

variables变量

enabled

enabled colliders will collide with other colliders, disabled colliders won't.

启用碰撞器将会碰撞其他碰撞器,禁用碰撞器就不会碰撞其他碰撞器。

attachedrigidbody

the rigidbody the collider is attached to.

碰撞器附加的刚体。

istrigger

is the collider a trigger?

碰撞器是一个触发器? (是否可以穿越)

material

the material used by the collider.

撞器使用的材质

sharedmaterial

the shared physic material of this collider.

碰撞器的共享物理材质。

bounds

the world space bounding volume of the collider.

碰撞器在世界坐标空间的边界框。

functions函数

closestpointonbounds

the closest point to the bounding box of the attached collider.

到附加碰撞器的边界框最近的点。

raycast

casts a ray that ignores all colliders except this one.

投射一个光线(ray),它忽略所有碰撞器,除了这个。

messages sent发送消息

ontriggerenter

ontriggerenter is called when the collider other enters the trigger.

当碰撞器other进入触发器时ontriggerenter被调用。

ontriggerexit

ontriggerexit is called when the collider other has stopped touching the trigger.

当碰撞器other停止触动触发器时,ontriggerexit被调用。

ontriggerstay

ontriggerstay is called almost all the frames for every collider other that is touching the trigger.

每个碰撞器other触动触发器,几乎在所有的帧ontriggerstay被调用。

oncollisionenter

oncollisionenter is called when this collider/rigidbody has begun touching another rigidbody/collider.

当collider/rigidbody开始触动另一个rigidbody/collider时oncollisionenter被调用。

oncollisionexit

oncollisionexit is called when this collider/rigidbody has stopped touching another rigidbody/collider.

当 collider/rigidbody停止触动另一个 rigidbody/collider时,oncollisionexit被调用。

oncollisionstay

oncollisionstay is called once per frame for every collider/rigidbody that is touching rigidbody/collider.

每个collider/rigidbody触动rigidbody/collider,将在每帧调用oncollisionstay。通俗的说,

inherited members继承成员

inherited variables继承变量

transform

thetransformattached to thisgameobject(null if there is none attached).

transform附加到gameobject(游戏物体)(如无附加则为空)。

rigidbody

therigidbodyattached to thisgameobject(null if there is none attached).

rigidbody附加到gameobject(游戏物体)(如无附加则为空)。

camera

thecameraattached to thisgameobject(null if there is none attached).

camera附加到gameobject(游戏物体)(如无附加则为空)。

light

thelightattached to thisgameobject(null if there is none attached).

light附加到gameobject(游戏物体)(如无附加则为空)。

animation

theanimationattached to thisgameobject(null if there is none attached).

animation附加到gameobject(游戏物体)(如无附加则为空)。

constantforce

theconstantforceattached to thisgameobject(null if there is none attached).

constantforce附加到gameobject(游戏物体)(如无附加则为空)。

renderer

therendererattached to thisgameobject(null if there is none attached).

renderer附加到gameobject(游戏物体)(如无附加则为空)。

audio

theaudiosourceattached to thisgameobject(null if there is none attached).

audiosource附加到gameobject(游戏物体)(如无附加则为空)。

guitext

theguitextattached to thisgameobject(null if there is none attached).

guitext附加到gameobject(游戏物体)(如无附加则为空)。

networkview

thenetworkviewattached to thisgameobject(read only). (null if there is none attached)

networkview附加到gameobject(游戏物体)(只读)(如无附加则为空)。

guitexture

theguitextureattached to thisgameobject(read only). (null if there is none attached)

guitexture附加到gameobject(游戏物体)(只读)(如无附加则为空)。

collider

thecolliderattached to thisgameobject(null if there is none attached).

collider附加到gameobject(游戏物体)(如无附加则为空)。

hingejoint

thehingejointattached to thisgameobject(null if there is none attached).

hingejoint附加到gameobject(游戏物体)(如无附加则为空)。

particleemitter

theparticleemitterattached to thisgameobject(null if there is none attached).

particleemitter附加到gameobject(游戏物体)(如无附加则为空)。

gameobject

the game object this component is attached to. a component is always attached to a game object.

组件附加的游戏物体。一个组件总是被附加到一个游戏物体。

tag

the tag of this game object.

游戏物体的标签。

name

the name of the object. //物体的名字

hideflags

should the object be hidden, saved with the scene or modifiable by the user?

物体是否被隐藏、保存在场景中或被用户修改?

相关阅读

文章点评
相关文章