Collider

class in UnityEngine

/

Inherits from:Component

Switch to Manual

Description

Базовый класс для всех коллайдеров.

See Also: BoxCollider, SphereCollider, CapsuleCollider, MeshCollider, PhysicMaterial, Rigidbody.

Если объект с коллайдером необходимо передвигать в процессе игры - вам следует прикрепить компонент Rigidbody к объекту. У компонента Rigidbody может быть включена опция isKinematic если Вы не хотите, чтобы объект физически взаимодействовал с другими объектами.

Variables

attachedArticulationBodyThe articulation body the collider is attached to.
attachedRigidbodyRigidbody к которому присоединен коллайдер.
boundsThe world space bounding volume of the collider (Read Only).
contactOffsetОграниченный обьем коллайдера в мировых координатах.
enabledEnabled Colliders will collide with other Colliders, disabled Colliders won't.
isTriggerЯвляется ли коллайдер триггером?
materialМатериал, используемый коллайдером.
sharedMaterialОбщий физический материал данного коллайдера.

Public Functions

ClosestPointReturns a point on the collider that is closest to a given location.
ClosestPointOnBoundsБлижайшая точка на ограничивающей рамке присоединенного коллайдера.
RaycastПускает [[Ray], который игнорирует все коллайдеры, кроме этого.

Messages

OnCollisionEnterOnCollisionEnter вызывается, когда этот collider/rigidbody начал соприкосновение с другим rigidbody/collider.
OnCollisionExitOnCollisionExit вызывается, когда collider/rigidbody прекращает контакт с другим rigidbody/collider.
OnCollisionStayOnCollisionStay вызывается один раз в кадр для каждого collider/rigidbody, который касается другого rigidbody/collider.
OnTriggerEnterWhen a GameObject collides with another GameObject, Unity calls OnTriggerEnter.
OnTriggerExitOnTriggerExit вызывается, когда Collider other перестает соприкасаться с триггером.
OnTriggerStayOnTriggerStay is called almost all the frames for every Collider other that is touching the trigger. The function is on the physics timer so it won't necessarily run every frame.

Inherited members

Variables

gameObjectИгровой объект к которому прикреплён данный компонент. Компонент всегда прикреплён к игровому объекту.
tagТег данного игрового объекта.
transformThe Transform attached to this GameObject.
hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameThe name of the object.

Public Functions

BroadcastMessageВызывает метод названный methodName на каждом MonoBehaviour этого game object-а или любого из его потомков.
CompareTagПомечен ли данный игровой объект тегом tag?
GetComponentReturns the component of Type type if the GameObject has one attached, null if it doesn't. Will also return disabled components.
GetComponentInChildrenВозвращает компонент типа type в GameObject или некоторого его потомка через поиск в глубину.
GetComponentInParentВозвращает все компоненты типа type из GameObject'а или из любого его родителя.
GetComponentsВозвращает все компоненты типа type в GameObject.
GetComponentsInChildrenВозвращает все компоненты типа type в GameObject или любому из его потомков.
GetComponentsInParentВозвращает все компоненты типа type в GameObject или любому из его родителей.
SendMessageВызывает метод с названием methodName в каждом MonoBehaviour в этом игровом объекте.
SendMessageUpwardsВызывает метод с именем methodName в каждом MonoBehaviour в этом игровом объекте и в каждом предке поведения.
TryGetComponentGets the component of the specified type, if it exists.
GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the object.

Static Functions

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeGets a list of all loaded objects of Type type.
InstantiateClones the object original and returns the clone.

Operators

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.