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-25 15:35:19 +00:00
|
|
|
|
|
|
|
this.LogInfo( "Remove", HierarchyName.Of( target ) );
|
2025-07-22 14:08:22 +00:00
|
|
|
|
|
|
|
target.SelfDestroy( queue );
|
|
|
|
|
2025-07-20 11:22:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|