Pular para o conteúdo
AstraDOCS

Astra.Components.Collider2D

Astra atual · C# · 06 out. 2026Referência de assinaturas

Colisor 2D: Caixa, círculo ou cápsula; sensor real. Família Física 2D · Formas.

Namespace: Astra.Components · Assembly: Astra.Scripting · Tipo: Struct

readonly struct Astra.Components.Collider2D

Colisor 2D: Caixa, círculo ou cápsula; sensor real. Família Física 2D · Formas.

Referência estudada: https://docs.godotengine.org/en/4.5/classes/class_collisionshape2d.html

Interfaces: Astra.Components.IComponentFacade<Astra.Components.Collider2D>.

Consulte também Colisor 2D para propriedades, valores iniciais, requisitos e edição em Play.

Membro Categoria
.ctor Method
OnCollisionEnter Method
OnCollisionExit Method
OnTriggerEnter Method
OnTriggerExit Method
Remove Method
Wrap Method
CapsuleHalfLength Property
Component Property
Friction Property
HalfX Property
HalfY Property
InstanceId Property
IsAlive Property
Object Property
OffsetX Property
OffsetY Property
Radius Property
Restitution Property
Sensor Property
Shape Property
TypeId Property

.ctor

public Collider2D(Astra.Component component)
Parâmetro Tipo Contrato
component Astra.Component

OnCollisionEnter

public Astra.ComponentSubscription OnCollisionEnter(Astra.Behavior owner, System.Action<Astra.ComponentEventArgs> handler)

Colisão: começou. Contato sólido começou; entregue aos dois colisores. Payload: Outro objeto: objeto

Parâmetro Tipo Contrato
owner Astra.Behavior
handler System.Action&lt;Astra.ComponentEventArgs&gt;

OnCollisionExit

public Astra.ComponentSubscription OnCollisionExit(Astra.Behavior owner, System.Action<Astra.ComponentEventArgs> handler)

Colisão: terminou. Contato sólido terminou; entregue aos dois colisores. Payload: Outro objeto: objeto

Parâmetro Tipo Contrato
owner Astra.Behavior
handler System.Action&lt;Astra.ComponentEventArgs&gt;

OnTriggerEnter

public Astra.ComponentSubscription OnTriggerEnter(Astra.Behavior owner, System.Action<Astra.ComponentEventArgs> handler)

Sensor: entrou. Outro corpo começou a sobrepor este sensor. Payload: Outro objeto: objeto

Parâmetro Tipo Contrato
owner Astra.Behavior
handler System.Action&lt;Astra.ComponentEventArgs&gt;

OnTriggerExit

public Astra.ComponentSubscription OnTriggerExit(Astra.Behavior owner, System.Action<Astra.ComponentEventArgs> handler)

Sensor: saiu. Outro corpo deixou de sobrepor este sensor. Payload: Outro objeto: objeto

Parâmetro Tipo Contrato
owner Astra.Behavior
handler System.Action&lt;Astra.ComponentEventArgs&gt;

Remove

public void Remove()

Remove a instância pelo ciclo nativo; dependências e ownership podem recusar.

Wrap

public static Astra.Components.Collider2D Wrap(Astra.Component component)
Parâmetro Tipo Contrato
component Astra.Component

CapsuleHalfLength

public float CapsuleHalfLength { get; set; }

Meia distância centros (m)

Faixa válida: 0.005 a 500.

Component

public Astra.Component Component { get; }

Friction

public float Friction { get; set; }

Atrito

Faixa válida: 0 a 1.

HalfX

public float HalfX { get; set; }

Meia largura (m)

Faixa válida: 0.005 a 500.

HalfY

public float HalfY { get; set; }

Meia altura (m)

Faixa válida: 0.005 a 500.

InstanceId

public ulong InstanceId { get; }

IsAlive

public bool IsAlive { get; }

Object

public Astra.GameObject Object { get; }

OffsetX

public float OffsetX { get; set; }

Centro X (m)

Faixa válida: -1000 a 1000.

OffsetY

public float OffsetY { get; set; }

Centro Y (m)

Faixa válida: -1000 a 1000.

Radius

public float Radius { get; set; }

Raio (m)

Faixa válida: 0.005 a 500.

Restitution

public float Restitution { get; set; }

Restituição

Faixa válida: 0 a 1.

Sensor

public bool Sensor { get; set; }

Sensor sem resposta

Shape

public Astra.Components.Collider2D.ShapeOption Shape { get; set; }

Forma

TypeId

public static string TypeId { get; }