17 lines
342 B
C#
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);
|
|
}
|
|
}
|