C# Класс UnityEngine.Rigidbody2D

Наследование: Component
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddForce ( Vector2 force, [ mode ) : void

Apply a force to the rigidbody.

AddForceAtPosition ( Vector2 force, Vector2 position, [ mode ) : void

Apply a force at a given position in space.

AddRelativeForce ( Vector2 relativeForce, [ mode ) : void

Adds a force to the rigidbody2D relative to its coordinate system.

Cast ( Vector2 direction, RaycastHit2D results, [ distance ) : int

All the Collider2D shapes attached to the Rigidbody2D are cast into the scene starting at each collider position ignoring the colliders attached to the same Rigidbody2D.

OverlapPoint ( Vector2 point ) : bool

Check if any of the Rigidbody2D colliders overlap a point in space.

Приватные методы

Метод Описание
AddTorque ( float torque, [ mode ) : void
Cast ( Vector2 direction, RaycastHit2D results ) : int
INTERNAL_CALL_Cast ( Rigidbody2D self, Vector2 &direction, RaycastHit2D results, float distance ) : int
INTERNAL_CALL_OverlapPoint ( Rigidbody2D self, Vector2 &point ) : bool
IsTouchingLayers ( [ layerMask ) : bool
SetDragBehaviour ( bool dragged ) : void

Описание методов

AddForce() публичный метод

Apply a force to the rigidbody.

public AddForce ( Vector2 force, [ mode ) : void
force Vector2 Components of the force in the X and Y axes.
mode [ The method used to apply the specified force.
Результат void

AddForceAtPosition() публичный метод

Apply a force at a given position in space.

public AddForceAtPosition ( Vector2 force, Vector2 position, [ mode ) : void
force Vector2 Components of the force in the X and Y axes.
position Vector2 Position in world space to apply the force.
mode [ The method used to apply the specified force.
Результат void

AddRelativeForce() публичный метод

Adds a force to the rigidbody2D relative to its coordinate system.

public AddRelativeForce ( Vector2 relativeForce, [ mode ) : void
relativeForce Vector2 Components of the force in the X and Y axes.
mode [ The method used to apply the specified force.
Результат void

Cast() публичный метод

All the Collider2D shapes attached to the Rigidbody2D are cast into the scene starting at each collider position ignoring the colliders attached to the same Rigidbody2D.

public Cast ( Vector2 direction, RaycastHit2D results, [ distance ) : int
direction Vector2 Vector representing the direction to cast each Collider2D shape.
results RaycastHit2D Array to receive results.
distance [ Maximum distance over which to cast the shape(s).
Результат int

OverlapPoint() публичный метод

Check if any of the Rigidbody2D colliders overlap a point in space.

public OverlapPoint ( Vector2 point ) : bool
point Vector2 A point in world space.
Результат bool