using System.Collections; using System.Collections.Generic; using UnityEngine; public class MapSection : MonoBehaviour { //public int width = 0; public int widthIn = 0; //Width at the entrance, including external wals public int widthOut = 0; //Width at the exit, including external walls public int widthMax = 0; //Greatest width at any point (including external walls) public int length = 0; int size; public int difficultyMin; //The lowest difficulty rating that this section can appear on public int difficultyMax; //And the highest public int weight = 1; //How many copies of this section should go on the list? //Lists of spawn points //One for each possible number of players public List spawns1; public List spawns2; public List spawns3; public List spawns4; public List spawns5; public List spawns6; public List spawns7; public List spawns8; public List entrances; //Ways into this map segment public List exits; //Ways out of this map segment public List collectableSpawns; //Which blocks can items spawn on? // Start is called before the first frame update void Start() { } public void InitSection() { size = widthMax * length; foreach (GameObject block in collectableSpawns) { block.GetComponent().isCollectableSpawnable = true; } } public void InitSection(int num) { name = num + " " + name; InitSection(); } public int getSize() { return size; } public void destroySection() { /*foreach (GameObject block in blocks) { Object.Destroy(block); }*/ /*Debug.Log("Destroying section " + name + ", position = " + transform.position.x + ", " + transform.position.y + ", " + transform.position.z); gameObject.transform.position = new Vector3(0.0f, 0.0f, 1000.0f);*/ Debug.Log("Destroying section " + name + ", position = " + transform.position.x + ", " + transform.position.y + ", " + transform.position.z); //gameObject.SetActive(false); Destroy(gameObject); } }