PuzzleGame/PuzzleGameProject/Assets/Scripts/GameManager.cs
2025-01-19 18:59:50 +01:00

37 lines
825 B
C#

using System;
using UnityEngine;
using Object = UnityEngine.Object;
public enum GameState
{
PickRoom,
RollDice
}
public class GameManager : MonoBehaviour
{
public GameState state;
public GameObject rooms;
public DiceRoller diceRoller;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
state = GameState.RollDice;
foreach (Transform roomTransform in rooms.transform)
{
roomTransform.gameObject.GetComponent<Room>().ValidRoomClicked += ValidRoomClicked;
}
diceRoller.RollDice();
}
void ValidRoomClicked(object sender, Room room) {
if (state == GameState.PickRoom)
{
room.SetRoomExplored();
}
}
void SetUpDice() {
}
}