Created some starting rooms and started working on the room, gamemanager, turnmanager, roommanager classes.
This commit is contained in:
parent
9d0ada54e0
commit
cb7aff20dd
101 changed files with 63867 additions and 0 deletions
19
PuzzleGameProject/Assets/Scripts/GameManager.cs
Normal file
19
PuzzleGameProject/Assets/Scripts/GameManager.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class GameManager : MonoBehaviour
|
||||
{
|
||||
public TurnManager turnManager;
|
||||
public RoomManager roomManager;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
roomManager.InnitializeRooms();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
2
PuzzleGameProject/Assets/Scripts/GameManager.cs.meta
Normal file
2
PuzzleGameProject/Assets/Scripts/GameManager.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 85fe57d438ef1ec4fa8b36b9c17c11a4
|
||||
36
PuzzleGameProject/Assets/Scripts/Room.cs
Normal file
36
PuzzleGameProject/Assets/Scripts/Room.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using TMPro;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class Room : MonoBehaviour
|
||||
{
|
||||
public int number;
|
||||
public GameObject numberTextObject;
|
||||
public List<GameObject> adjacentRooms;
|
||||
public bool isEntrance;
|
||||
private bool isExplored = false;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
if (isEntrance)
|
||||
{
|
||||
SetPropertiesOfEntrance();
|
||||
}
|
||||
|
||||
TextMeshProUGUI numberText = numberTextObject.GetComponent<TextMeshProUGUI>();
|
||||
numberText.SetText(number.ToString());
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void SetPropertiesOfEntrance()
|
||||
{
|
||||
this.gameObject.GetComponent<SpriteRenderer>().color = Color.green;
|
||||
this.isEntrance = true;
|
||||
}
|
||||
}
|
||||
2
PuzzleGameProject/Assets/Scripts/Room.cs.meta
Normal file
2
PuzzleGameProject/Assets/Scripts/Room.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 129987f6d2a5e97458682506ddec4576
|
||||
29
PuzzleGameProject/Assets/Scripts/RoomManager.cs
Normal file
29
PuzzleGameProject/Assets/Scripts/RoomManager.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class RoomManager : MonoBehaviour
|
||||
{
|
||||
public GameObject rooms;
|
||||
private List<GameObject> _entranceRooms = new List<GameObject>();
|
||||
|
||||
public void InnitializeRooms()
|
||||
{
|
||||
AddEntranceRoomsToList(rooms);
|
||||
}
|
||||
|
||||
private void AddEntranceRoomsToList(GameObject rooms)
|
||||
{
|
||||
foreach (Transform roomTransform in rooms.transform)
|
||||
{
|
||||
if (roomTransform.gameObject.GetComponent<Room>().isEntrance)
|
||||
{
|
||||
_entranceRooms.Add(roomTransform.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<GameObject> GetEntranceRooms()
|
||||
{
|
||||
return _entranceRooms;
|
||||
}
|
||||
}
|
||||
2
PuzzleGameProject/Assets/Scripts/RoomManager.cs.meta
Normal file
2
PuzzleGameProject/Assets/Scripts/RoomManager.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f0c75429168c5fb418e656b295433971
|
||||
24
PuzzleGameProject/Assets/Scripts/TurnManager.cs
Normal file
24
PuzzleGameProject/Assets/Scripts/TurnManager.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class TurnManager : MonoBehaviour
|
||||
{
|
||||
public RoomManager roomManager;
|
||||
private int _turn = 0;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void takeTurn()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
2
PuzzleGameProject/Assets/Scripts/TurnManager.cs.meta
Normal file
2
PuzzleGameProject/Assets/Scripts/TurnManager.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6d900f1b1caebac429626fd7fe820582
|
||||
Loading…
Add table
Add a link
Reference in a new issue