diff options
Diffstat (limited to 'Towers/Components/TowerComponent.gd')
-rw-r--r-- | Towers/Components/TowerComponent.gd | 4 |
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 |