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

32 lines
480 B
C#
Raw Normal View History

2024-05-12 17:03:20 +00:00
using Godot;
namespace Rokojori
{
[GlobalClass]
2025-01-08 18:46:17 +00:00
public partial class Delay : SequenceAction
2024-05-12 17:03:20 +00:00
{
[Export]
public float duration;
2024-05-19 15:59:41 +00:00
[Export]
2025-01-08 18:46:17 +00:00
public TimeLine timeLine;
2024-05-19 15:59:41 +00:00
2024-05-12 17:03:20 +00:00
2025-01-08 18:46:17 +00:00
protected override void _OnTrigger()
2024-05-12 17:03:20 +00:00
{
2024-05-19 15:59:41 +00:00
var sequenceID = DispatchStart();
2024-05-12 17:03:20 +00:00
2025-01-19 20:35:51 +00:00
var eventID = TimeLineManager.ScheduleEventIn( timeLine, duration,
2025-01-21 20:58:56 +00:00
( tle ) =>
2024-05-19 15:59:41 +00:00
{
DispatchEnd( sequenceID );
}
);
2024-05-12 17:03:20 +00:00
}
2024-05-19 15:59:41 +00:00
2024-05-12 17:03:20 +00:00
}
}