Added a basic GameHandler
This commit is contained in:
36
3D blobici/Assets/Scripts/MainGame/GameHandler.cs
Normal file
36
3D blobici/Assets/Scripts/MainGame/GameHandler.cs
Normal 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>();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user