16 lines
284 B
C#
16 lines
284 B
C#
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);
|
|
}
|
|
}
|