Implemented basic room exploration logic.
This commit is contained in:
parent
cb7aff20dd
commit
4bd34a1335
13 changed files with 186 additions and 92 deletions
|
|
@ -1,19 +1,30 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
public enum GameState
|
||||
{
|
||||
PickRoom
|
||||
}
|
||||
public class GameManager : MonoBehaviour
|
||||
{
|
||||
public TurnManager turnManager;
|
||||
public RoomManager roomManager;
|
||||
public GameState state;
|
||||
public GameObject rooms;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
roomManager.InnitializeRooms();
|
||||
state = GameState.PickRoom;
|
||||
foreach (Transform roomTransform in rooms.transform)
|
||||
{
|
||||
roomTransform.gameObject.GetComponent<Room>().ValidRoomClicked += ValidRoomClicked;
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
void ValidRoomClicked(object sender, Room room) {
|
||||
if (state == GameState.PickRoom)
|
||||
{
|
||||
room.SetRoomExplored();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue