EdgeCollider2D

class in UnityEngine

/

Inherits from:Collider2D

Switch to Manual

Description

Коллайдер для 2D физики, представляющий произвольный набор связанных граней (линий), определенных множеством его вершин.

Variables

adjacentEndPointDefines the position of a virtual point adjacent to the end point of the EdgeCollider2D.
adjacentStartPointDefines the position of a virtual point adjacent to the start point of the EdgeCollider2D.
edgeCountПолучает количество граней.
edgeRadiusControls the radius of all edges created by the collider.
pointCountПолучает количество точек.
pointsПолучает или задает точки, определяющие множественные непрерывные грани.
useAdjacentEndPointSet this to true to use the adjacentEndPoint to form the collision normal that is used to calculate the collision response when a collision occurs at the Edge Collider's end point. Set this to false to not use the adjacentEndPoint, and the collision normal becomes the direction of motion of the collision.
useAdjacentStartPointSet this to true to use the adjacentStartPoint to form the collision normal that is used to calculate the collision response when a collision occurs at the Edge Collider's start point. Set this to false to not use the adjacentStartPoint, and the collision normal becomes the direction of motion of the collision.

Public Functions

GetPointsGets all the points that define a set of continuous edges.
ResetСброс до единственной грани, состоящей из двух точек.
SetPointsSets all the points that define a set of continuous edges.

Inherited members

Variables

enabledВключенное Поведение обновляется, выключенное Поведение не обновляется.
isActiveAndEnabledHas the Behaviour had active and enabled called?
attachedRigidbodyThe Rigidbody2D attached to the Collider2D.
bouncinessGet the bounciness used by the collider.
boundsОграничивающая зона действия коллайдера в мировых координатах.
compositeGet the CompositeCollider2D that is available to be attached to the collider.
densityThe density of the collider used to calculate its mass (when auto mass is enabled).
frictionGet the friction used by the collider.
isTriggerЯвляется ли этот коллайдер триггером?
offsetThe local offset of the collider geometry.
shapeCountКоличество отдельных фигурных областей в коллайдере.
sharedMaterialThe PhysicsMaterial2D that is applied to this collider.
usedByCompositeSets whether the Collider will be used or not used by a CompositeCollider2D.
usedByEffectorWhether the collider is used by an attached effector or not.
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

CastCasts the Collider shape into the Scene starting at the Collider position ignoring the Collider itself.
ClosestPointReturns a point on the perimeter of this Collider that is closest to the specified position.
CreateMeshCreates a planar Mesh that is identical to the area defined by the Collider2D geometry.
DistanceCalculates the minimum separation of this collider against another collider.
GetContactsRetrieves all contact points for this Collider.
GetShapeHashGenerates a simple hash value based upon the geometry of the Collider2D.
IsTouchingCheck whether this collider is touching the collider or not.
IsTouchingLayersChecks whether this collider is touching any colliders on the specified layerMask or not.
OverlapColliderGet a list of all colliders that overlap this collider.
OverlapPointПроверяет, пересекается ли коллайдер с точкой в пространстве.
RaycastCasts a ray into the Scene that starts at the Collider position and ignores the Collider itself.
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.

Messages

OnCollisionEnter2DПередается когда входящий коллайдер контактирует с коллайдером данного объекта (только 2D физика).
OnCollisionExit2DПередается, когда коллайдер другого объекта перестает соприкасаться с коллайдером этого объекта (только 2D физика).
OnCollisionStay2DПередается каждый кадр, пока коллайдер другого объекта контактирует с коллайдером данного объекта (только 2D физика).
OnTriggerEnter2DПередается, когда другой обьект входит в триггер присоединенный к данному обьекту (только 2D физика).
OnTriggerExit2DПередается когда другой объект покидает триггер, присоединенный к данному объекту(только 2D физика).
OnTriggerStay2DПередается каждый кадр, пока другой объект находится в триггере, присоединенном к этому объекту (только 2D физика).