Fixed teleporters

This commit is contained in:
Maddo 2025-03-05 12:27:15 +01:00
commit 49cfb52d20
15 changed files with 102 additions and 84 deletions

View file

@ -13,11 +13,11 @@ public partial class GameManager : Node2D
public static GameManager Instance { get; private set; }
private Hud _hud;
private PlayerStateMachine _player;
private PlayerFSMProxy _player;
public GameState GameState { get; private set; }
public PlayerStateMachine Player => _player;
public PlayerStateMachine Player => _player.PlayerFSM;
private Node2D _cameraTarget;
@ -53,7 +53,7 @@ public partial class GameManager : Node2D
[Signal]
public delegate void PlayerRespawnedEventHandler();
public Vector2 LastCheckpointPosition { get; set; }
// Called when the node enters the scene tree for the first time.
@ -110,7 +110,7 @@ public partial class GameManager : Node2D
{
}
public override void _Process(double delta)
{
if (GameState is GameState.Paused && Input.IsActionJustPressed(PauseActionName))
@ -160,7 +160,7 @@ public partial class GameManager : Node2D
if (_player != null) return;
//_player = this.CreateChild<PlayerMovement>(PlayerTemplate, PlayerSpawnMarker.Position );
_player = PlayerTemplate.Instantiate<PlayerStateMachine>();
_player = PlayerTemplate.Instantiate<PlayerFSMProxy>();
this.CallDeferred("add_child", _player);
_player.Transform = this.GlobalTransform;