rokojori_action_library/Runtime/Time/ModulateTimeLineSpeed.cs

34 lines
566 B
C#

using Godot;
using Rokojori.Extensions;
namespace Rokojori
{
[Tool][GlobalClass ]
public partial class ModulateTimelineSpeed : SequenceAction
{
[Export]
public Timeline timeline;
[Export]
public AnimationCurve curve;
protected override void _OnTrigger()
{
var tm = Unique<TimelineManager>.Get();
if ( tm == null || timeline == null || curve == null )
{
return;
}
var id = DispatchStart();
tm.Modulate( timeline, curve, r => { DispatchEnd( id ); });
}
}
}