Building Manager

You can find all the information about Building Manager here.

This component is the core of the system. It contains a Building Parts reference list and keeps in cache all the components related to the system in the scene during runtime.

It includes a list of Building Types used to define the type of Building Parts, as well as some optimization features such as Area Of Interest and Building Batching.

Optimization Features

  • Area Of Interest Disabling all Building Areas and Building Sockets that are far from the camera to prevent reaching the colliders limit in your scene. "PhysX engine used by Unity only handles a maximum of 65536 colliders in a scene."

  • Building Batching Reduce thousands of drawcalls into one call and increase performance significantly.

Explore fields description in the Inspector by hovering your cursor over them. You can find more information about this here: Tooltip Attribute.


API

You can access this class by including the following namespace:

using EasyBuildSystem.Features.Runtime.Buildings.Manager;

This class inherits from Singleton class and can be called like this:

BuildingManager.Instance

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

Events

/// <summary>
/// Event triggered when a Building Part is being placed.
/// </summary>
BuildingManager.Instance.OnPlacingBuildingPartEvent.AddListener((BuildingPart part) => { });

/// <summary>
/// Event triggered when a Building Part is being destroyed.
/// </summary>
BuildingManager.Instance.OnDestroyingBuildingPartEvent.AddListener((BuildingPart part) => { });

/// <summary>
/// Event triggered when a Building Area is registered.
/// </summary>
BuildingManager.Instance.OnRegisterBuildingAreaEvent.AddListener((BuildingArea area) => { });

/// <summary>
/// Event triggered when a Building Area is unregistered.
/// </summary>
BuildingManager.Instance.OnUnregisterBuildingAreaEvent.AddListener((BuildingArea area) => { });

/// <summary>
/// Event triggered when a Building Part is registered.
/// </summary>
BuildingManager.Instance.OnRegisterBuildingPartEvent.AddListener((BuildingPart part) => { });

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

/// <summary>
/// Event triggered when a Building Socket is registered.
/// </summary>
BuildingManager.Instance.OnRegisterBuildingSocketEvent.AddListener((BuildingSocket socket) => { });

/// <summary>
/// Event triggered when a Building Socket is unregistered.
/// </summary>
BuildingManager.Instance.OnUnregisterBuildingSocketEvent.AddListener((BuildingSocket socket) => { });

/// <summary>
/// Event triggered when a Building Group is registered.
/// </summary>
BuildingManager.Instance.OnRegisterBuildingGroupEvent.AddListener((BuildingGroup group) => { });

/// <summary>
/// Event triggered when a Building Group is unregistered.
/// </summary>
BuildingManager.Instance.OnUnregisterBuildingGroupEvent.AddListener((BuildingGroup group) => { });

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

Last updated