---
description: You can find all the information about Building Group here.
---

# Building Group

This component is managed by the [Building Manager](building-manager) to group all the [Building Parts](building-part) based on their proximity. The **Building Batching** feature included in the [Building Manager](building-manager) also leverages this component to batch the [Building Parts](building-part) together, resulting in a performance improvement in scenes with a large number of parts.

{% hint style="info" %}
Explore fields description in the Inspector by hovering your cursor over them.\
You can find more information about this here: [Tooltip Attribute](https://docs.unity3d.com/ScriptReference/TooltipAttribute.html).
{% endhint %}

***

## API

You can access this class by including the following namespace:

```csharp
using EasyBuildSystem.Features.Runtime.Buildings.Group;
```

Here is a list of all the events and methods of this component that can be called:

{% tabs %}
{% tab title="Events" %}
#### Events

```csharp
/// <summary>
/// Event triggered when a Building Part is registered in this group.
/// </summary>
OnRegisterBuildingPartEvent.AddListener((BuildingPart part) => { });

/// <summary>
/// Event triggered when a Building Part is unregistered in this group.
/// </summary>
OnUnregisterBuildingPartEvent.AddListener((BuildingPart part) => { });

/// <summary>
/// Event triggered when the Building Group is batched.
/// </summary>
OnBatchedBuildingGroupEvent.AddListener(() => { });

/// <summary>
/// Event triggered when the Building Group is unbatched.
/// </summary>
OnUnbatchedBuildingGroupEvent.AddListener(() => { });
```
{% endtab %}

{% tab title="Methods" %}
#### Methods

```csharp
/// <summary>
/// Batches the building group, combining the renderers into a single batch.
/// </summary>
BatchBuildingGroup(BuildingPart part);

/// <summary>
/// Unbatches the building group, restoring the individual renderers.
/// </summary>
UnbatchBuildingGroup(BuildingPart part);
```
{% endtab %}
{% endtabs %}



All of the methods related to this component can be found in the file "BuildingGroup.cs".\
If you have any specific questions about the API, feel free to contact us.
