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.

66 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. public int weight = 1; //How many copies of this section should go on the list?
  15. //Lists of spawn points
  16. //One for each possible number of players
  17. public List<GameObject> spawns1;
  18. public List<GameObject> spawns2;
  19. public List<GameObject> spawns3;
  20. public List<GameObject> spawns4;
  21. public List<GameObject> spawns5;
  22. public List<GameObject> spawns6;
  23. public List<GameObject> spawns7;
  24. public List<GameObject> spawns8;
  25. public List<GameObject> entrances; //Ways into this map segment
  26. public List<GameObject> exits; //Ways out of this map segment
  27. // Start is called before the first frame update
  28. void Start()
  29. {
  30. }
  31. public void InitSection()
  32. {
  33. size = widthMax * length;
  34. }
  35. public void InitSection(int num)
  36. {
  37. name = num + " " + name;
  38. InitSection();
  39. }
  40. public int getSize()
  41. {
  42. return size;
  43. }
  44. public void destroySection()
  45. {
  46. /*foreach (GameObject block in blocks)
  47. {
  48. Object.Destroy(block);
  49. }*/
  50. /*Debug.Log("Destroying section " + name + ", position = " + transform.position.x + ", " + transform.position.y + ", " + transform.position.z);
  51. gameObject.transform.position = new Vector3(0.0f, 0.0f, 1000.0f);*/
  52. Debug.Log("Destroying section " + name + ", position = " + transform.position.x + ", " + transform.position.y + ", " + transform.position.z);
  53. //gameObject.SetActive(false);
  54. Destroy(gameObject);
  55. }
  56. }