rj-action-library/Runtime/Actions/Conditional/Once.cs

30 lines
478 B
C#
Raw Normal View History

using Godot;
using System.Collections.Generic;
namespace Rokojori
{
[Tool]
[GlobalClass, Icon("res://addons/rokojori_action_library/Icons/ConditionalAction.svg")]
public partial class Once : Action
{
[Export]
public Action action;
[Export]
public bool canTrigger = true;
protected override void _OnTrigger()
{
if ( ! canTrigger )
{
return;
}
canTrigger = false;
Action.Trigger( action );
}
}
}