33 lines
534 B
C#
33 lines
534 B
C#
|
|
||
|
using Godot;
|
||
|
|
||
|
|
||
|
namespace Rokojori
|
||
|
{
|
||
|
[GlobalClass ]
|
||
|
public partial class ModulateTimeLineSpeed : RJSequenceAction
|
||
|
{
|
||
|
[Export]
|
||
|
public RJTimeLine timeline;
|
||
|
|
||
|
[Export]
|
||
|
public AnimationCurve curve;
|
||
|
|
||
|
|
||
|
public 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 ); });
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|