reset stains on map change
This commit is contained in:
parent
6f6c5d06e1
commit
39b28d3554
2 changed files with 7 additions and 0 deletions
|
@ -148,6 +148,7 @@ func change_map(map: PackedScene) -> void:
|
||||||
Save.current_file.save_to_file()
|
Save.current_file.save_to_file()
|
||||||
# clear
|
# clear
|
||||||
clear_collectibles()
|
clear_collectibles()
|
||||||
|
StainLayer.reset()
|
||||||
#Loop is so no more than one level is loaded at a time
|
#Loop is so no more than one level is loaded at a time
|
||||||
SceneManager.current_scene = map.instance()
|
SceneManager.current_scene = map.instance()
|
||||||
|
|
||||||
|
|
|
@ -15,3 +15,9 @@ func _process(delta: float) -> void:
|
||||||
func add_stain(stain: Node2D) -> void:
|
func add_stain(stain: Node2D) -> void:
|
||||||
viewport.add_child(stain)
|
viewport.add_child(stain)
|
||||||
viewport.render_target_update_mode = Viewport.UPDATE_ONCE
|
viewport.render_target_update_mode = Viewport.UPDATE_ONCE
|
||||||
|
|
||||||
|
|
||||||
|
func reset() -> void:
|
||||||
|
for child in viewport.get_children():
|
||||||
|
child.queue_free()
|
||||||
|
viewport.render_target_update_mode = Viewport.UPDATE_ONCE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue