Level teleporter

This commit is contained in:
MaddoScientisto 2025-02-21 22:48:12 +01:00
commit f6c7f1e3bc
2 changed files with 31 additions and 4 deletions

View file

@ -0,0 +1,26 @@
using System;
using System.Collections;
using System.Threading.Tasks;
using Godot;
namespace Cirno.Scripts.Activables;
public partial class LevelTeleporter : Teleporter
{
[Export]
public new string Target {get; private set;}
protected override async Task Teleport(PlayerMovement player)
{
if (string.IsNullOrWhiteSpace(Target)) return;
player.RequestMovementDisable(true);
await TweenPlayer(player);
_particles.Emitting = true;
await Task.Delay((int)(TeleportAnimationLength * 1000));
GlobalState.Instance.GotoScene(Target);
}
}