GameMapLayer.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using Sirenix.OdinInspector;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using UnityEngine;
  6. [Serializable]
  7. public struct SpawnTime
  8. {
  9. public int id;
  10. public List<int> pos;
  11. public int startTime;
  12. public int endTime;
  13. public int num;
  14. [HideInInspector] public float Hp;
  15. [HideInInspector] public float moveSpeed;
  16. [HideInInspector] public float attack;
  17. }
  18. public enum WaveType
  19. {
  20. Common = 0, //正常
  21. Tower = 1, //塔波
  22. FromTower = 2, //根据塔血量出
  23. }
  24. /// <summary>
  25. /// A layer consists of a series of values in a grid.
  26. /// Each GameMap can have one or more layers.
  27. /// </summary>
  28. [System.Serializable]
  29. public class GameMapLayer
  30. {
  31. /// <summary> The layer's grid of tile values. -1 is an empty tile, else a value related to GameMapTile.id will be present </summary>
  32. public int[] grid = new int[0];
  33. public int duration;
  34. public string buildingId;
  35. public float buildingHp;
  36. public string name;
  37. public Dictionary<int, SpawnTime> spawnTimes = new();
  38. public WaveType waveType;
  39. public bool isDynamic;
  40. public int dynamicSheet;
  41. // ----------------------------------------------------------------------------------------------------------------
  42. }