BuildingInstantiator
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
Responsible for instantiating and setting up a placed building object in the world. This component handles the creation of a building instance, assigning its transform, and attaching necessary components like PlaceableInstance.
Source File: addons/grid_building/systems/building/components/building_instantiator.gd
Extends: GBSystemsComponent
Private Properties
- Property:
_indicator_context: [IndicatorContext](./indicator-context/)(private) - Property:
_building_state: [BuildingState](./building-state/)(private) - Property:
_building_settings: [BuildingSettings](./building-settings/)(private)
Constants
- Constant:
DEFAULT_NAME = "BuildingInstantiator" - Constant:
WARNING_INVALID_PLACEABLE = "Invalid placeable resource. Can't instantiate. [%s]" - Constant:
WARNING_NO_PREVIEW = "No preview instance provided to instantiate from. Returning null."
Public Methods
resolve_gb_dependencies
Resolve dependencies from the composition container.
p_container: GBCompositionContainer - Container with system dependencies
instantiate_building
Instantiates a Placeable’s scene, sets its properties, and adds it to the world. Returns the instantiated Node2D if successful, otherwise null.
p_placeable: Placeable - The Placeable resource to instantiate
p_preview: Node2D - The preview node that holds the desired global_transform