newlon/scripts/projectiles/CompoundProjectile.cs

22 lines
395 B
C#

using Godot;
public partial class CompoundProjectile : Node2D
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
GetTree().ProcessFrame += ReleaseCompound;
}
public void ReleaseCompound()
{
GetTree().ProcessFrame -= ReleaseCompound;
foreach (var child in GetChildren())
{
child.Reparent(GetParent());
}
QueueFree();
}
}