C# Class UnityEngine.Rigidbody2D

Inheritance: Component
ファイルを表示 Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Public Methods

Method Description
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.

Private Methods

Method Description
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

Method Details

AddForce() public method

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.
return void

AddForceAtPosition() public method

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.
return void

AddRelativeForce() public method

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.
return void

Cast() public method

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).
return int

OverlapPoint() public method

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

public OverlapPoint ( Vector2 point ) : bool
point Vector2 A point in world space.
return bool