rj-action-library/Runtime/Time/ModulateTimeLineSpeed.cs

33 lines
533 B
C#
Raw Normal View History

2025-01-03 12:09:23 +00:00
using Godot;
namespace Rokojori
{
[GlobalClass ]
2025-01-08 18:46:17 +00:00
public partial class ModulateTimeLineSpeed : SequenceAction
2025-01-03 12:09:23 +00:00
{
[Export]
2025-01-08 18:46:17 +00:00
public TimeLine timeline;
2025-01-03 12:09:23 +00:00
[Export]
public AnimationCurve curve;
2025-01-08 18:46:17 +00:00
protected override void _OnTrigger()
2025-01-03 12:09:23 +00:00
{
var tm = Unique<TimeLineManager>.Get();
if ( tm == null || timeline == null || curve == null )
{
return;
}
var id = DispatchStart();
tm.Modulate( timeline, curve, r => { DispatchEnd( id ); });
}
}
}