feat: Shape & Circle Collider Constructors
This commit is contained in:
parent
574104c224
commit
ab2489f6cf
|
@ -11,4 +11,12 @@ public class Collider2DCircleBehaviour : Collider2DBehaviourBase, ICircleCollide
|
|||
|
||||
|
||||
public override void CalculateCollider() => CircleWorld = Transform.TransformCircle(CircleLocal);
|
||||
|
||||
|
||||
public Collider2DCircleBehaviour() { }
|
||||
public Collider2DCircleBehaviour(Circle circle)
|
||||
{
|
||||
CircleLocal = circle;
|
||||
Recalculate();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,4 +11,12 @@ public class Collider2DShapeBehaviour : Collider2DBehaviourBase, IShapeCollider2
|
|||
protected Shape _shapeWorld = new([new(1f, 1f), new(-1f, 1f), new(-1f, -1f), new(1f, -1f)]);
|
||||
|
||||
public override void CalculateCollider() => Transform.TransformShape(ShapeLocal, ref _shapeWorld);
|
||||
|
||||
|
||||
public Collider2DShapeBehaviour() { }
|
||||
public Collider2DShapeBehaviour(Shape shape)
|
||||
{
|
||||
ShapeLocal = shape;
|
||||
Recalculate();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue