diff --git a/src/cs/MonoGame.Extended.Collisions/CollisionComponent.cs b/src/cs/MonoGame.Extended.Collisions/CollisionComponent.cs index e89fa91f..9677c14f 100644 --- a/src/cs/MonoGame.Extended.Collisions/CollisionComponent.cs +++ b/src/cs/MonoGame.Extended.Collisions/CollisionComponent.cs @@ -27,7 +27,7 @@ namespace MonoGame.Extended.Collisions private HashSet<(Layer, Layer)> _layerCollision = new(); /// - /// Creates a collision tree covering the specified area. + /// Creates component with default layer, which is a collision tree covering the specified area (using . /// /// Boundary of the collision tree. public CollisionComponent(RectangleF boundary) @@ -35,6 +35,17 @@ namespace MonoGame.Extended.Collisions SetDefaultLayer(new Layer(new QuadTreeSpace(boundary))); } + /// + /// Creates component with specifies default layer. + /// If layer is null, method creates component without default layer. + /// + /// Default layer + public CollisionComponent(Layer layer = null) + { + if (layer is not null) + SetDefaultLayer(layer); + } + /// /// The main layer has the name from . /// The main layer collision with itself and all other layers.