PuzzleGame/PuzzleGameProject/Assets/Scripts/DungeonSelection/DungeonLoader.cs
2025-03-03 16:22:19 +01:00

25 lines
No EOL
539 B
C#

using System;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace DungeonSelection
{
public class DungeonLoader : MonoBehaviour
{
private void OnEnable()
{
GameEvents.LoadDungeon += LoadDungeon;
}
private void OnDisable()
{
GameEvents.LoadDungeon -= LoadDungeon;
}
public static void LoadDungeon(DungeonData dungeonData)
{
SceneManager.LoadScene(dungeonData.SceneName);
}
}
}