BuildingState

Resets preview when it exits the scene tree.

sort Weight: 10

Resets preview when it exits the scene tree.

Version: v5.0.0

STABLE

Inherits: RefCounted
Source: building_state.gd
Parsing: AST-based for maximum accuracy with symbol typing


Variables

_owner_context:

Shared reference to the user controlling the building system.


placed_parent:

The parent node where objects are placed during build mode.


preview:

The current preview object in build mode, moving with the mouse until placed.


Signals

success(build_action_data: BuildActionData)

Emitted when an object is successfully placed into the game world.

Parameters:

  • build_action_data: BuildActionData

failed(build_action_data: BuildActionData)

Emitted when a build action fails.

Parameters:

  • build_action_data: BuildActionData

preview_changed(preview: Node)

Emitted when the build preview instance changes.

Parameters:

  • preview: Node

placed_parent_changed(placed_parent: Node)

Emitted when the parent node for placed objects changes.

Parameters:

  • placed_parent: Node

system_changed(system: BuildingSystem)

Emitted when the connected building system changes (currently unused).

Parameters:

  • system: BuildingSystem

Methods

_init

Signature: _init(p_owner_context : GBOwnerContext: Variant) -> void

Returns: void

Parameters:

  • p_owner_context : GBOwnerContext: Variant

get_owner

Signature: get_owner() -> GBOwner

Returns the placer node from the _owner_context, or null if unset.

Returns: GBOwner


get_editor_issues

Signature: get_editor_issues() -> Array

Validates the state’s runtime properties, skipping checks in the editor or when build mode is off.

Returns: Array


get_runtime_issues

Signature: get_runtime_issues() -> Array

Checks properties that should be set at runtime before building system operations

Returns: Array


_on_placed_parent_tree_exited

Signature: _on_placed_parent_tree_exited() -> void

Resets placed_parent when it exits the scene tree.

Returns: void


_on_preview_tree_exited

Signature: _on_preview_tree_exited() -> void

Resets preview when it exits the scene tree.

Returns: void