mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-19 14:13:47 +00:00
Added GTWeen
This commit is contained in:
parent
457998788e
commit
2036e4e748
152 changed files with 5889 additions and 7 deletions
|
|
@ -0,0 +1,52 @@
|
|||
using Godot;
|
||||
using GTweens.Extensions;
|
||||
using GTweens.Tweens;
|
||||
|
||||
namespace GTweensGodot.Extensions;
|
||||
|
||||
public static class AudioStreamPlayer3DExtensions
|
||||
{
|
||||
public static GTween TweenVolumeDb(this AudioStreamPlayer3D target, float to, float duration)
|
||||
{
|
||||
return GTweenExtensions.Tween(
|
||||
() => target.VolumeDb,
|
||||
current => target.VolumeDb = current,
|
||||
to,
|
||||
duration,
|
||||
GodotObjectExtensions.GetGodotObjectValidationFunction(target)
|
||||
);
|
||||
}
|
||||
|
||||
public static GTween TweenPitchScale(this AudioStreamPlayer3D target, float to, float duration)
|
||||
{
|
||||
return GTweenExtensions.Tween(
|
||||
() => target.PitchScale,
|
||||
current => target.PitchScale = current,
|
||||
to,
|
||||
duration,
|
||||
GodotObjectExtensions.GetGodotObjectValidationFunction(target)
|
||||
);
|
||||
}
|
||||
|
||||
public static GTween TweenAttenuationFilterDb(this AudioStreamPlayer3D target, float to, float duration)
|
||||
{
|
||||
return GTweenExtensions.Tween(
|
||||
() => target.AttenuationFilterDb,
|
||||
current => target.AttenuationFilterDb = current,
|
||||
to,
|
||||
duration,
|
||||
GodotObjectExtensions.GetGodotObjectValidationFunction(target)
|
||||
);
|
||||
}
|
||||
|
||||
public static GTween TweenAttenuationFilterCutoffHz(this AudioStreamPlayer3D target, float to, float duration)
|
||||
{
|
||||
return GTweenExtensions.Tween(
|
||||
() => target.AttenuationFilterCutoffHz,
|
||||
current => target.AttenuationFilterCutoffHz = current,
|
||||
to,
|
||||
duration,
|
||||
GodotObjectExtensions.GetGodotObjectValidationFunction(target)
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue