started research skills
This commit is contained in:
@@ -2,6 +2,7 @@ class_name BuildingBase
|
||||
extends Node2D
|
||||
|
||||
var _building_data: Building
|
||||
var building_data_scene
|
||||
|
||||
@onready var sprite_2d: Sprite2D = $Sprite2D
|
||||
|
||||
@@ -9,11 +10,9 @@ func initialize(data: Building, grid_location: Vector2i) -> void:
|
||||
_building_data = data
|
||||
position = Grid.grid_to_world_center(grid_location)
|
||||
sprite_2d.texture = _building_data.atlas_texture
|
||||
var building_data_scene = _building_data.world_scene.instantiate()
|
||||
add_child(building_data_scene)
|
||||
if _building_data.world_scene:
|
||||
building_data_scene = _building_data.world_scene.instantiate()
|
||||
add_child(building_data_scene)
|
||||
|
||||
func _ready() -> void:
|
||||
_building_data.ready(self)
|
||||
|
||||
func interact() -> bool:
|
||||
return false
|
||||
func interact(on_interaction_finished: Callable) -> bool:
|
||||
return building_data_scene.interact(on_interaction_finished)
|
||||
|
||||
Reference in New Issue
Block a user