rj-action-library/Runtime/Actions/RemoveNode.cs

27 lines
416 B
C#
Raw Normal View History

2025-07-20 11:22:12 +00:00
using Godot;
using System.Collections.Generic;
namespace Rokojori
{
[Tool][GlobalClass]
public partial class RemoveNode : Action
{
[Export]
public Node target;
2025-07-22 14:08:22 +00:00
[Export]
public bool queue = true;
2025-07-20 11:22:12 +00:00
protected override void _OnTrigger()
{
2025-07-22 14:08:22 +00:00
if ( target == null )
2025-07-20 11:22:12 +00:00
{
2025-07-22 14:08:22 +00:00
return;
2025-07-20 11:22:12 +00:00
}
2025-07-22 14:08:22 +00:00
target.SelfDestroy( queue );
2025-07-20 11:22:12 +00:00
}
}
}