30 lines
478 B
C#
30 lines
478 B
C#
|
|
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 );
|
|
|
|
}
|
|
}
|
|
} |