GrassDetail.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using System;
  2. using UnityEngine;
  3. namespace MTE
  4. {
  5. /// <summary>
  6. /// Grass Prototype info
  7. /// </summary>
  8. [Serializable]
  9. internal class GrassDetail : Detail
  10. {
  11. public const float DefaultMinWidth = 0.1f;
  12. public const float DefaultMaxWidth = 0.2f;
  13. public const float DefaultMinHeight = 0.1f;
  14. public const float DefaultMaxHeight = 0.2f;
  15. public const GrassType DefaultGrassType = GrassType.OneQuad;
  16. [SerializeField]
  17. private Material material;
  18. [SerializeField]
  19. private float minWidth;
  20. [SerializeField]
  21. private float maxWidth;
  22. [SerializeField]
  23. private float minHeight;
  24. [SerializeField]
  25. private float maxHeight;
  26. [SerializeField]
  27. private GrassType grassType;
  28. public Material Material
  29. {
  30. get
  31. {
  32. return this.material;
  33. }
  34. set
  35. {
  36. this.material = value;
  37. }
  38. }
  39. public float MinWidth
  40. {
  41. get
  42. {
  43. return this.minWidth;
  44. }
  45. set
  46. {
  47. this.minWidth = value;
  48. }
  49. }
  50. public float MaxWidth
  51. {
  52. get
  53. {
  54. return this.maxWidth;
  55. }
  56. set
  57. {
  58. this.maxWidth = value;
  59. }
  60. }
  61. public float MinHeight
  62. {
  63. get
  64. {
  65. return this.minHeight;
  66. }
  67. set
  68. {
  69. this.minHeight = value;
  70. }
  71. }
  72. public float MaxHeight
  73. {
  74. get
  75. {
  76. return this.maxHeight;
  77. }
  78. set
  79. {
  80. this.maxHeight = value;
  81. }
  82. }
  83. public GrassType GrassType
  84. {
  85. get { return this.grassType; }
  86. set { this.grassType = value; }
  87. }
  88. public GrassDetail ShallowCopy()
  89. {
  90. var copy = new GrassDetail();
  91. copy.material = material ;
  92. copy.minWidth = minWidth ;
  93. copy.maxWidth = maxWidth ;
  94. copy.minHeight = minHeight ;
  95. copy.maxHeight = maxHeight ;
  96. copy.grassType = grassType ;
  97. return copy;
  98. }
  99. }
  100. }