mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:55:35 +00:00
28 lines
No EOL
651 B
C#
28 lines
No EOL
651 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Threading.Tasks;
|
|
using Godot;
|
|
|
|
namespace Cirno.Scripts.Activables;
|
|
|
|
public partial class LevelTeleporter : Teleporter
|
|
{
|
|
[Export]
|
|
public string LevelPath {get; private set;}
|
|
|
|
protected override async Task Teleport(PlayerMovement player)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(LevelPath)) return;
|
|
player.RequestMovementDisable(true);
|
|
|
|
await TweenPlayer(player);
|
|
|
|
_particles.Emitting = true;
|
|
|
|
await player.Teleport();
|
|
|
|
await Task.Delay((int)(TeleportAnimationLength * 1000));
|
|
|
|
GlobalState.Instance.GotoScene(LevelPath);
|
|
}
|
|
} |