Level Generator
This commit is contained in:
28
3D blobici/Assets/Prefabs/Scripts/RoomHandler.cs
Normal file
28
3D blobici/Assets/Prefabs/Scripts/RoomHandler.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using UnityEngine;
|
||||
|
||||
///<summary>
|
||||
/// Object handling Room logic
|
||||
///</summary>
|
||||
///
|
||||
public class RoomHandler : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject wallNorth;
|
||||
[SerializeField] private GameObject wallSouth;
|
||||
[SerializeField] private GameObject wallEast;
|
||||
[SerializeField] private GameObject wallWest;
|
||||
|
||||
/// <summary>
|
||||
/// Creates entrances to corridors leading to other rooms
|
||||
/// </summary>
|
||||
/// <param name="northOpen"></param>
|
||||
/// <param name="southOpen"></param>
|
||||
/// <param name="eastOpen"></param>
|
||||
/// <param name="westOpen"></param>
|
||||
public void SetEntrances(bool northOpen, bool southOpen, bool eastOpen, bool westOpen)
|
||||
{
|
||||
wallNorth.SetActive(!northOpen);
|
||||
wallSouth.SetActive(!southOpen);
|
||||
wallEast.SetActive(!eastOpen);
|
||||
wallWest.SetActive(!westOpen);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user