找回密碼
 注冊帳號

掃一掃,訪問微社區

collider 碰撞器

2015-1-4 17:07| 發布者: 楊炎| 查看: 2027| 評論: 0|原作者: 蠻牛|來自: unity3d腳本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?

物體是否被隱藏、保存在場景中或被用戶修改?

相關閱讀

文章點評
相關文章
极速时时彩开奖最快的网站