Class PlacementInstantiator
- Namespace
- GridPlacement.GDScript
- Assembly
- MoonBark.GridPlacement.GDScript.dll
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.
class PlacementInstantiator extends GBSystemsComponent
PlacementInstantiator
Fields
DEFAULT_NAME
const DEFAULT_NAME = "PlacementInstantiator"
WARNING_INVALID_PLACEABLE
const WARNING_INVALID_PLACEABLE = "Invalid placeable resource. Can't instantiate. [%s]"
WARNING_NO_PREVIEW
const WARNING_NO_PREVIEW = "No preview instance provided to instantiate from. Returning null."
Properties
instance
var instance = p_placeable.packed_scene.instantiate()
placeable_instance
var placeable_instance = PlaceableInstance.new(p_placeable.resource_path)
Methods
resolve_gb_dependencies
func resolve_gb_dependencies(p_container: PlacementContainer) -> void:
Parameters
p_container
Returns
instantiate_building
func instantiate_building(p_placeable: Placeable, p_preview: Node2D) -> Node2D:
Parameters
p_placeablep_preview