Added a basic GameHandler

This commit is contained in:
2025-06-30 18:31:40 +02:00
parent bcce66a3f5
commit 668354d601
4 changed files with 52 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
using UnityEngine;
public class GameHandler : MonoBehaviour
{
private MapGenManager mapGen;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Awake()
{
mapGen = GetComponent<MapGenManager>();
mapGen.OnGenerationComplete += HandleStart;
}
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void HandleStart(MapGenManager map)
{
var Rooms = map.GridToRoom;
/*----- For now only open the doors -----*/
foreach (var room in mapGen.GridToRoom)
{
var rh = room.Value.GetComponent<RoomHandler>();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5520a437c5690d24695f9830bbd741b0