mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-05 20:25:54 +00:00
Added GTWeen
This commit is contained in:
parent
457998788e
commit
2036e4e748
152 changed files with 5889 additions and 7 deletions
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue