Timescalable components
This commit is contained in:
parent
df940e2ba6
commit
e527d1da44
11 changed files with 83 additions and 24 deletions
17
scripts/components/TimeScalableAnimationTree.cs
Normal file
17
scripts/components/TimeScalableAnimationTree.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue