Set spawn points
This commit is contained in:
15
Scripts/AreaExit.cs
Normal file
15
Scripts/AreaExit.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Godot;
|
||||
|
||||
public partial class AreaExit : Node3D
|
||||
{
|
||||
[Export]
|
||||
private int _levelIndex;
|
||||
|
||||
|
||||
private void OnExitEntered(Node3D node)
|
||||
{
|
||||
GD.Print("Exit reached");
|
||||
var main = GetTree().Root.GetNode<Main>("/root/Main");
|
||||
main.LoadNextLevel(_levelIndex);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user