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

@ -1,7 +1,9 @@
using System;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Godot;
using GTweensGodot.Extensions;
namespace Cirno.Scripts.Activables;
@ -148,13 +150,15 @@ public partial class Teleporter : Activable
protected async Task TweenPlayer(PlayerMovement player)
{
await player.TweenGlobalPosition(GlobalPosition + new Vector2(0, -4f), TeleportAnimationLength).PlayAsync(CancellationToken.None);
// Create a Tween for the teleport animation
Tween tween = GetTree().CreateTween();
tween.SetEase(Tween.EaseType.InOut);
tween.SetTrans(Tween.TransitionType.Sine);
tween.TweenProperty(player, "global_position", GlobalPosition + new Vector2(0,-4f), TeleportAnimationLength);
// Wait for the tween to finish
await ToSignal(tween, "finished");
// Tween tween = GetTree().CreateTween();
// tween.SetEase(Tween.EaseType.InOut);
// tween.SetTrans(Tween.TransitionType.Sine);
// tween.TweenProperty(player, "global_position", GlobalPosition + new Vector2(0,-4f), TeleportAnimationLength);
//
// // Wait for the tween to finish
// await ToSignal(tween, "finished");
}
}