newlon/scripts/components/TimeScalableAnimationTree.cs
2025-07-08 00:05:23 +05:00

17 lines
342 B
C#

using Godot;
namespace Newlon.Components;
public partial class TimeScalableAnimationTree : AnimationTree
{
[Export] private Entity entity;
public override void _Ready()
{
entity.OnLocalTimescaleChanged += OnTimescaleChanged;
}
private void OnTimescaleChanged(float timescale)
{
Set("parameters/TimeScale/scale", timescale);
}
}