21 lines
412 B
GDScript
21 lines
412 B
GDScript
extends Node
|
|
|
|
@onready var vfx_canvas: CanvasLayer = %VFXLayer
|
|
|
|
func spawn_vfx_at_pos(vfx_scene: PackedScene,position: Vector2) -> void:
|
|
|
|
var vfx := vfx_scene.instantiate() as Node2D
|
|
vfx.add_to_group("ReedVFX")
|
|
vfx_canvas.add_child(vfx)
|
|
|
|
vfx.global_position = position
|
|
|
|
|
|
func clear_all():
|
|
for child in vfx_canvas.get_children():
|
|
child.queue_free()
|
|
|
|
|
|
func get_canvas() -> CanvasLayer:
|
|
return vfx_canvas
|