VFXTypesDeprecated.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.VFX;
  4. namespace UnityEditor.VFX
  5. {
  6. static class Deprecated
  7. {
  8. public static readonly Type[] s_Types = new Type[]
  9. {
  10. typeof(Circle),
  11. typeof(ArcCircle),
  12. //Simple Sphere is still used for Conform & Distance to Sphere
  13. typeof(ArcSphere),
  14. typeof(Cylinder),
  15. typeof(Cone),
  16. typeof(ArcCone),
  17. typeof(Torus),
  18. typeof(ArcTorus)
  19. };
  20. }
  21. [VFXType(VFXTypeAttribute.Usage.ExcludeFromProperty, "Circle (Deprecated)"), Serializable]
  22. struct Circle
  23. {
  24. [Tooltip("Sets the center of the circle."), VFXSpace(SpaceableType.Position)]
  25. public Vector3 center;
  26. [Tooltip("Sets the radius of the circle.")]
  27. public float radius;
  28. public static Circle defaultValue = new Circle { radius = 1.0f };
  29. }
  30. [VFXType(VFXTypeAttribute.Usage.ExcludeFromProperty, "Arc Circle (Deprecated)"), Serializable]
  31. struct ArcCircle
  32. {
  33. [Tooltip("Sets the Circle shape input.")]
  34. public Circle circle;
  35. [Angle, Range(0, Mathf.PI * 2.0f), Tooltip("Controls how much of the circle is used. The value is in radians.")]
  36. public float arc;
  37. public static ArcCircle defaultValue = new ArcCircle { circle = Circle.defaultValue, arc = 2.0f * Mathf.PI };
  38. }
  39. [VFXType(VFXTypeAttribute.Usage.ExcludeFromProperty, "Arc Sphere (Deprecated)"), Serializable]
  40. struct ArcSphere
  41. {
  42. public Sphere sphere;
  43. [Angle, Range(0, Mathf.PI * 2.0f), Tooltip("Controls how much of the sphere is used. The value is in radians.")]
  44. public float arc;
  45. public static ArcSphere defaultValue = new ArcSphere { sphere = Sphere.defaultValue, arc = 2.0f * Mathf.PI };
  46. }
  47. [VFXType(VFXTypeAttribute.Usage.ExcludeFromProperty, "Cylinder (Deprecated)"), Serializable]
  48. struct Cylinder
  49. {
  50. [Tooltip("Sets the center of the cylinder."), VFXSpace(SpaceableType.Position)]
  51. public Vector3 center;
  52. [Tooltip("Sets the radius of the cylinder.")]
  53. public float radius;
  54. [Tooltip("Sets the height of the cylinder.")]
  55. public float height;
  56. public static Cylinder defaultValue = new Cylinder { radius = 1.0f, height = 1.0f };
  57. }
  58. [VFXType(VFXTypeAttribute.Usage.ExcludeFromProperty, "Cone (Deprecated)"), Serializable]
  59. struct Cone
  60. {
  61. [Tooltip("Sets the center of the cone."), VFXSpace(SpaceableType.Position)]
  62. public Vector3 center;
  63. [Min(0.0f), Tooltip("Sets the base radius of the cone.")]
  64. public float radius0;
  65. [Min(0.0f), Tooltip("Sets the top radius of the cone.")]
  66. public float radius1;
  67. [Tooltip("Sets the height of the cone.")]
  68. public float height;
  69. public static Cone defaultValue = new Cone { radius0 = 1.0f, radius1 = 0.1f, height = 1.0f };
  70. }
  71. [VFXType(VFXTypeAttribute.Usage.ExcludeFromProperty, "Arc Cone (Deprecated)"), Serializable]
  72. struct ArcCone
  73. {
  74. [Tooltip("Sets the center of the cone."), VFXSpace(SpaceableType.Position)]
  75. public Vector3 center;
  76. [Min(0.0f), Tooltip("Sets the base radius of the cone.")]
  77. public float radius0;
  78. [Min(0.0f), Tooltip("Sets the top radius of the cone.")]
  79. public float radius1;
  80. [Tooltip("Sets the height of the cone.")]
  81. public float height;
  82. [Angle, Range(0, Mathf.PI * 2.0f), Tooltip("Controls how much of the cone is used. The value is in radians.")]
  83. public float arc;
  84. public static ArcCone defaultValue = new ArcCone { radius0 = 1.0f, radius1 = 0.1f, height = 1.0f, arc = 2.0f * Mathf.PI };
  85. }
  86. [VFXType(VFXTypeAttribute.Usage.ExcludeFromProperty, "Torus (Deprecated)"), Serializable]
  87. struct Torus
  88. {
  89. [Tooltip("Sets the center of the torus."), VFXSpace(SpaceableType.Position)]
  90. public Vector3 center;
  91. [Tooltip("Sets the radius of the torus ring.")]
  92. public float majorRadius;
  93. [Tooltip("Sets the thickness of the torus ring.")]
  94. public float minorRadius;
  95. public static Torus defaultValue = new Torus { majorRadius = 1.0f, minorRadius = 0.1f };
  96. }
  97. [VFXType(VFXTypeAttribute.Usage.ExcludeFromProperty, "Arc Torus (Deprecated)"), Serializable]
  98. struct ArcTorus
  99. {
  100. [Tooltip("Sets the center of the torus."), VFXSpace(SpaceableType.Position)]
  101. public Vector3 center;
  102. [Tooltip("Sets the radius of the torus ring.")]
  103. public float majorRadius;
  104. [Tooltip("Sets the thickness of the torus ring.")]
  105. public float minorRadius;
  106. [Angle, Range(0, Mathf.PI * 2.0f), Tooltip("Controls how much of the torus is used.")]
  107. public float arc;
  108. public static ArcTorus defaultValue = new ArcTorus { majorRadius = 1.0f, minorRadius = 0.1f, arc = 2.0f * Mathf.PI };
  109. }
  110. }