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.

57 lines
1.7 KiB

  1. using System.Collections.Generic;
  2. using UnityEngine;
  3. public class MapSection : MonoBehaviour
  4. {
  5. //public int width = 0;
  6. public int widthIn = 0; //Width at the entrance, including external wals
  7. public int widthOut = 0; //Width at the exit, including external walls
  8. public int widthMax = 0; //Greatest width at any point (including external walls)
  9. public int length = 0;
  10. int size;
  11. public int difficultyMin; //The lowest difficulty rating that this section can appear on
  12. public int difficultyMax; //And the highest
  13. public int weight = 1; //How many copies of this section should go on the list?
  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. public List<GameObject> collectableSpawns; //Which blocks can items spawn on?
  27. public void InitSection()
  28. {
  29. size = widthMax * length;
  30. foreach (GameObject block in collectableSpawns)
  31. {
  32. block.GetComponent<Block>().isCollectableSpawnable = true;
  33. }
  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. Destroy(gameObject, 0.0f);
  47. }
  48. }