用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:collider2d:collider2d

Collider2D 二维碰撞器

Namespace: UnityEngine

Inherits from: Behaviour

Description 描述

Parent class for collider types used with 2D gameplay.

2D游戏碰撞器类型的父类。

See Also: BoxCollider2D class, CircleCollider2D class, PolygonCollider2D class.

Variables 变量

attachedRigidbodyThe Rigidbody2D attached to the Collider2D's GameObject.
Rigidbody2D附加到该Collider2D的游戏对象上。
boundsThe world space bounding area of the collider.
碰撞器的世界空间边界区域。
densityTThe density of the collider used to calculate its mass (when auto mass is enabled)
碰撞器的密度用来它的质量(当自动质量启用)。
isTriggerIs this collider configured as a trigger?
这个碰撞器被配置作为一个触发器?
offsetThe local offset of the collider geometry.
该碰撞器几何体的局部偏移。
shapeCountThe number of separate shaped regions in the collider.
该碰撞器上单独图形区域的数量。
sharedMaterialThe PhysicsMaterial2D that is applied to this collider.
应用到这个碰撞器的PhysicsMaterial2D 。
usedByEffectorWhether the collider is used by an attached effector or not.
是否该碰撞器用于效果器。

Functions 函数

OverlapPointCheck if a collider overlaps a point in space.
在世界空间检查碰撞器重叠的一个点。
IsTouchingCheck whether this collider is touching the collider or not.
检测该碰撞器是否正触摸的碰撞器。
IsTouchingLayersChecks whether this collider is touching any colliders on the specified layerMask or not.
检测该碰撞器是否是触摸指定层蒙版的碰撞器。

Messages 消息

OnCollisionEnter2DSent when an incoming collider makes contact with this object's collider (2D physics only).
当传入的碰撞器接触到这个对象的碰撞器时发送(仅2D物理)。
OnCollisionExit2DSent when a collider on another object stops touching this object's collider (2D physics only).
当另一个对象上的碰撞器停止接触这个对象的碰撞器时发送(仅2D物理)。
OnCollisionStay2DSent each frame where a collider on another object is touching this object's collider (2D physics only).
当另个对象的碰撞器正在触碰这个对象的碰撞器时,每帧发送(仅2D物理)。
OnTriggerEnter2DSent when another object enters a trigger collider attached to this object (2D physics only).
当另个对象的碰撞器进入到这个对象的触发碰撞器时发送(仅2D物理)。
OnTriggerExit2DSent when another object leaves a trigger collider attached to this object (2D physics only).
当另个对象的碰撞器离开这个对象的触发碰撞器时发送(仅2D物理)。
OnTriggerStay2DSent each frame where another object is within a trigger collider attached to this object (2D physics only).
当另个对象的碰撞器停留在这个对象的触发碰撞器内时每帧发送(仅2D物理)。
script/unityengine/classes/collider2d/collider2d.txt · 最后更改: 2016/08/02 05:26 (外部编辑)