rokojori_action_library/Runtime/Time/ModulateTimelineSpeed.cs

34 lines
566 B
C#
Raw Normal View History

2025-01-03 12:09:23 +00:00
using Godot;
2026-05-22 12:25:02 +00:00
using Rokojori.Extensions;
2025-01-03 12:09:23 +00:00
namespace Rokojori
{
[Tool][GlobalClass ]
2026-05-22 12:25:02 +00:00
public partial class ModulateTimelineSpeed : SequenceAction
2025-01-03 12:09:23 +00:00
{
[Export]
2026-05-22 12:25:02 +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
{
2026-05-22 12:25:02 +00:00
var tm = Unique<TimelineManager>.Get();
2025-01-03 12:09:23 +00:00
if ( tm == null || timeline == null || curve == null )
{
return;
}
var id = DispatchStart();
tm.Modulate( timeline, curve, r => { DispatchEnd( id ); });
}
}
}