using System.Collections; using System.Collections.Generic; using UnityEngine; public class Room : MonoBehaviour { [SerializeField] int Width, Height; // Gridsize for Generation List doors; List spawnpoints; [SerializeField] GameObject doorsRootObject; [SerializeField] GameObject spawnpointRootObject; [SerializeField] private Objective objective; // Use this for initialization void Start () { doors = new List(); foreach (Door d in doorsRootObject.GetComponentsInChildren()) { doors.Add(d); } spawnpoints = new List(); foreach (Transform t in spawnpointRootObject.GetComponentsInChildren()) { spawnpoints.Add(t); } } public void Lock() { foreach (Door d in doors) { d.Lock(); } } public void Unlock() { foreach (Door d in doors) { d.Unlock(); } } public List GetSpawnpoints() { return spawnpoints; } }