summaryrefslogtreecommitdiff
path: root/Towers/Components/TowerComponent.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-11-19 15:24:50 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-11-19 15:24:50 +0100
commit72863ffa31e27f4c6be862d80472cfb897fccaea (patch)
treece04be8d77b10c797c8ff854c8ff1a219eb1af46 /Towers/Components/TowerComponent.gd
parent63d2a59042fb9d90a586ad85d8364de7c38aea8e (diff)
next commitHEADmain
Diffstat (limited to 'Towers/Components/TowerComponent.gd')
-rw-r--r--Towers/Components/TowerComponent.gd4
1 files changed, 3 insertions, 1 deletions
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