mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 16:05:54 +00:00
Level teleporter
This commit is contained in:
parent
2124701d49
commit
f6c7f1e3bc
2 changed files with 31 additions and 4 deletions
|
|
@ -31,7 +31,7 @@ public partial class Teleporter : Activable
|
|||
// [Export]
|
||||
// public GpuParticles2D Particles { get; set; }
|
||||
|
||||
private GpuParticles2D _particles;
|
||||
protected GpuParticles2D _particles;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
|
|
@ -118,14 +118,15 @@ public partial class Teleporter : Activable
|
|||
|
||||
// Teleport player to target if active
|
||||
if (!IsEnabled) return;
|
||||
if (Target is null) return;
|
||||
|
||||
|
||||
// Call Teleport here
|
||||
_ = Teleport(player);
|
||||
}
|
||||
|
||||
private async Task Teleport(PlayerMovement player)
|
||||
protected virtual async Task Teleport(PlayerMovement player)
|
||||
{
|
||||
if (Target is null) return;
|
||||
player.RequestMovementDisable(true);
|
||||
|
||||
await TweenPlayer(player);
|
||||
|
|
@ -140,7 +141,7 @@ public partial class Teleporter : Activable
|
|||
player.RequestMovementDisable(false);
|
||||
}
|
||||
|
||||
private async Task TweenPlayer(PlayerMovement player)
|
||||
protected async Task TweenPlayer(PlayerMovement player)
|
||||
{
|
||||
// Create a Tween for the teleport animation
|
||||
Tween tween = GetTree().CreateTween();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue