Class Collider2D
Assembly: UnityEngine.dll
Syntax
[RequireComponent(typeof(Transform))]
public class Collider2D : Behaviour
Properties
attachedRigidbody
Declaration
public Rigidbody2D attachedRigidbody { get; }
Property Value
bounciness
Declaration
public float bounciness { get; }
Property Value
bounds
Declaration
public Bounds bounds { get; }
Property Value
composite
Declaration
public CompositeCollider2D composite { get; }
Property Value
density
Declaration
public float density { get; set; }
Property Value
friction
Declaration
public float friction { get; }
Property Value
isTrigger
Declaration
public bool isTrigger { get; set; }
Property Value
offset
Declaration
public Vector2 offset { get; set; }
Property Value
shapeCount
Declaration
public int shapeCount { get; }
Property Value
sharedMaterial
Declaration
public PhysicsMaterial2D sharedMaterial { get; set; }
Property Value
usedByComposite
Declaration
public bool usedByComposite { get; set; }
Property Value
usedByEffector
Declaration
public bool usedByEffector { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
Declaration
[ExcludeFromDocs]
public int Cast(Vector2 direction, ContactFilter2D contactFilter, RaycastHit2D[] results)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
[ExcludeFromDocs]
public int Cast(Vector2 direction, ContactFilter2D contactFilter, RaycastHit2D[] results, float distance)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public int Cast(Vector2 direction, ContactFilter2D contactFilter, RaycastHit2D[] results, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("true")] bool ignoreSiblingColliders)
Parameters
Returns
|
Improve this Doc
View Source
Cast(Vector2, RaycastHit2D[])
Declaration
[ExcludeFromDocs]
public int Cast(Vector2 direction, RaycastHit2D[] results)
Parameters
Returns
|
Improve this Doc
View Source
Cast(Vector2, RaycastHit2D[], Single)
Declaration
[ExcludeFromDocs]
public int Cast(Vector2 direction, RaycastHit2D[] results, float distance)
Parameters
Returns
|
Improve this Doc
View Source
Cast(Vector2, RaycastHit2D[], Single, Boolean)
Declaration
public int Cast(Vector2 direction, RaycastHit2D[] results, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("true")] bool ignoreSiblingColliders)
Parameters
Returns
|
Improve this Doc
View Source
Distance(Collider2D)
Declaration
public ColliderDistance2D Distance(Collider2D collider)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public int GetContacts(Collider2D[] colliders)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public int GetContacts(ContactFilter2D contactFilter, Collider2D[] colliders)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public int GetContacts(ContactFilter2D contactFilter, ContactPoint2D[] contacts)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public int GetContacts(ContactPoint2D[] contacts)
Parameters
Returns
IsTouching(Collider2D)
Declaration
public bool IsTouching(Collider2D collider)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public bool IsTouching(Collider2D collider, ContactFilter2D contactFilter)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public bool IsTouching(ContactFilter2D contactFilter)
Parameters
Returns
|
Improve this Doc
View Source
IsTouchingLayers()
Declaration
[ExcludeFromDocs]
public bool IsTouchingLayers()
Returns
IsTouchingLayers(Int32)
Declaration
public bool IsTouchingLayers([DefaultValue("Physics2D.AllLayers")] int layerMask)
Parameters
Type |
Name |
Description |
Int32 |
layerMask |
|
Returns
|
Improve this Doc
View Source
Declaration
public int OverlapCollider(ContactFilter2D contactFilter, Collider2D[] results)
Parameters
Returns
OverlapPoint(Vector2)
Declaration
public bool OverlapPoint(Vector2 point)
Parameters
Type |
Name |
Description |
Vector2 |
point |
|
Returns
|
Improve this Doc
View Source
Declaration
[ExcludeFromDocs]
public int Raycast(Vector2 direction, ContactFilter2D contactFilter, RaycastHit2D[] results)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public int Raycast(Vector2 direction, ContactFilter2D contactFilter, RaycastHit2D[] results, [DefaultValue("Mathf.Infinity")] float distance)
Parameters
Returns
|
Improve this Doc
View Source
Raycast(Vector2, RaycastHit2D[])
Declaration
[ExcludeFromDocs]
public int Raycast(Vector2 direction, RaycastHit2D[] results)
Parameters
Returns
|
Improve this Doc
View Source
Raycast(Vector2, RaycastHit2D[], Single)
Declaration
[ExcludeFromDocs]
public int Raycast(Vector2 direction, RaycastHit2D[] results, float distance)
Parameters
Returns
|
Improve this Doc
View Source
Raycast(Vector2, RaycastHit2D[], Single, Int32)
Declaration
[ExcludeFromDocs]
public int Raycast(Vector2 direction, RaycastHit2D[] results, float distance, int layerMask)
Parameters
Returns
|
Improve this Doc
View Source
Raycast(Vector2, RaycastHit2D[], Single, Int32, Single)
Declaration
[ExcludeFromDocs]
public int Raycast(Vector2 direction, RaycastHit2D[] results, float distance, int layerMask, float minDepth)
Parameters
Returns
|
Improve this Doc
View Source
Raycast(Vector2, RaycastHit2D[], Single, Int32, Single, Single)
Declaration
public int Raycast(Vector2 direction, RaycastHit2D[] results, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("Physics2D.AllLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
Parameters
Returns
Extension Methods