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

39 lines
694 B
C#

using Godot;
namespace Rokojori
{
[GlobalClass]
public partial class Delay : SequenceAction
{
[Export]
public float duration;
[Export]
public string message;
[Export]
public TimeLine timeLine;
protected override void _OnTrigger()
{
var sequenceID = DispatchStart();
var eventID = TimeLineScheduler.ScheduleEventIn( timeLine, duration,
( eventID ) =>
{
RJLog.Log( ">> delay ended", Time.GetTicksMsec(), sequenceID, eventID );
DispatchEnd( sequenceID );
}
);
RJLog.Log( ">> delay started", Time.GetTicksMsec(), sequenceID, eventID );
}
}
}