Refactor Player and Character
This commit is contained in:
@@ -9,15 +9,16 @@ public partial class AreaExit : Node3D
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
|
||||
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
|
||||
}
|
||||
|
||||
|
||||
private void OnExitEntered(Node3D node)
|
||||
{
|
||||
GD.Print("Exit reached");
|
||||
var main = GetTree().Root.GetNode<Main>("/root/Main");
|
||||
main.LoadNextLevel(_levelIndex);
|
||||
_gameManager.ResetPlayerPosition();
|
||||
GD.Print("Exit reached");
|
||||
var main = GetTree().Root.GetNode<Main>("/root/Main");
|
||||
main.LoadNextLevel(_levelIndex);
|
||||
if (node is Player player)
|
||||
player.SpawnPoint.SetPlayerPosition(player);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user