Add game manager

This commit is contained in:
2023-09-03 00:30:18 -07:00
parent cf2642be2c
commit 23443546b2
6 changed files with 44 additions and 36 deletions

View File

@@ -6,11 +6,15 @@ public partial class Main : Node
{
[Export]
public Array<PackedScene> Levels;
[Export]
public PackedScene GameManager;
public void LoadLevel(int indexToLoad)
{
var sceneToLoad = Levels.ElementAt(indexToLoad);
CallDeferred(nameof(DeferredGoToScene), sceneToLoad);
var gameManager = GameManager.Instantiate();
AddChild(gameManager);
}
public void LoadNextLevel(int currentSceneIndex)