You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.0 KiB

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class MapSection : MonoBehaviour
  5. {
  6. //public int width = 0;
  7. public int widthIn = 0; //Width at the entrance, including external wals
  8. public int widthOut = 0; //Width at the exit, including external walls
  9. public int widthMax = 0; //Greatest width at any point (including external walls)
  10. public int length = 0;
  11. int size;
  12. public int difficultyMin; //The lowest difficulty rating that this section can appear on
  13. public int difficultyMax; //And the highest
  14. //Lists of spawn points
  15. //One for each possible number of players
  16. public List<GameObject> spawns1;
  17. public List<GameObject> spawns2;
  18. public List<GameObject> spawns3;
  19. public List<GameObject> spawns4;
  20. public List<GameObject> spawns5;
  21. public List<GameObject> spawns6;
  22. public List<GameObject> spawns7;
  23. public List<GameObject> spawns8;
  24. public List<GameObject> entrances; //Ways into this map segment
  25. public List<GameObject> exits; //Ways out of this map segment
  26. // Start is called before the first frame update
  27. void Start()
  28. {
  29. }
  30. public void InitSection()
  31. {
  32. size = widthMax * length;
  33. }
  34. public void InitSection(int num)
  35. {
  36. name = num + " " + name;
  37. InitSection();
  38. }
  39. public int getSize()
  40. {
  41. return size;
  42. }
  43. public void destroySection()
  44. {
  45. /*foreach (GameObject block in blocks)
  46. {
  47. Object.Destroy(block);
  48. }*/
  49. /*Debug.Log("Destroying section " + name + ", position = " + transform.position.x + ", " + transform.position.y + ", " + transform.position.z);
  50. gameObject.transform.position = new Vector3(0.0f, 0.0f, 1000.0f);*/
  51. Debug.Log("Destroying section " + name + ", position = " + transform.position.x + ", " + transform.position.y + ", " + transform.position.z);
  52. //gameObject.SetActive(false);
  53. Destroy(gameObject);
  54. }
  55. }