using Godot;

public partial class StandardParticles : Node2D
{
	private int counter = 0;
	private int counterMax = 0;
	public override void _Ready()
	{
		foreach (GpuParticles2D emitter in GetChildren())
		{
			emitter.Emitting = true;
			counterMax += 1;
			emitter.Finished += MarkForDestruction;
		}
	}
	public void MarkForDestruction()
	{
		if (Engine.IsEditorHint()) return;
		if (++counter < counterMax) return;
		QueueFree();
	}
}
