godot-plateformer/addons/reedfx/vfx/ReedVFXSystem.gd

21 lines
412 B
GDScript3
Raw Permalink Normal View History

2025-12-29 11:54:31 +08:00
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