Added GTWeen

This commit is contained in:
Marco 2025-02-24 11:52:50 +01:00
commit 2036e4e748
152 changed files with 5889 additions and 7 deletions

View file

@ -0,0 +1,30 @@
using Godot;
using GTweens.Extensions;
using GTweens.Tweens;
namespace GTweensGodot.Extensions;
public static class AudioStreamPlayer2DExtensions
{
public static GTween TweenVolumeDb(this AudioStreamPlayer2D target, float to, float duration)
{
return GTweenExtensions.Tween(
() => target.VolumeDb,
current => target.VolumeDb = current,
to,
duration,
GodotObjectExtensions.GetGodotObjectValidationFunction(target)
);
}
public static GTween TweenPitchScale(this AudioStreamPlayer2D target, float to, float duration)
{
return GTweenExtensions.Tween(
() => target.PitchScale,
current => target.PitchScale = current,
to,
duration,
GodotObjectExtensions.GetGodotObjectValidationFunction(target)
);
}
}