SupaLidlGame/Extensions/Particles2D.cs

16 lines
332 B
C#

using Godot;
namespace SupaLidlGame.Extensions;
public static class Particles2D
{
public static void EmitOneShot(this GpuParticles2D particles)
{
particles.GetTree().CreateTimer(particles.Lifetime).Timeout += () =>
{
particles.QueueFree();
};
particles.Emitting = true;
}
}