From 72863ffa31e27f4c6be862d80472cfb897fccaea Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Tue, 19 Nov 2024 15:24:50 +0100 Subject: next commit --- Towers/Components/TowerComponent.gd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Towers/Components/TowerComponent.gd') diff --git a/Towers/Components/TowerComponent.gd b/Towers/Components/TowerComponent.gd index 30b1c44..9a16845 100644 --- a/Towers/Components/TowerComponent.gd +++ b/Towers/Components/TowerComponent.gd @@ -66,7 +66,9 @@ func update_with_network_data(data: NetworkData): level = data.level static func from_network_data(data: NetworkData) -> TowerComponent: - var component = preload("res://Towers/Components/TowerComponent.gd").new() + var component = load( + "res://Towers/Components/%sComponent.tscn" % [ComponentType.keys()[data.type]] + ).instantiate() component.type = data.type component.level = data.level -- cgit v1.2.3