설명 없음
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.

Light2DShape.cs 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. namespace UnityEngine.Rendering.Universal
  2. {
  3. public sealed partial class Light2D
  4. {
  5. [SerializeField] int m_ShapeLightParametricSides = 5;
  6. [SerializeField] float m_ShapeLightParametricAngleOffset = 0.0f;
  7. [SerializeField] float m_ShapeLightParametricRadius = 1.0f;
  8. [SerializeField] float m_ShapeLightFalloffSize = 0.50f;
  9. [SerializeField] Vector2 m_ShapeLightFalloffOffset = Vector2.zero;
  10. [SerializeField] Vector3[] m_ShapePath = null;
  11. float m_PreviousShapeLightFalloffSize = -1;
  12. int m_PreviousShapeLightParametricSides = -1;
  13. float m_PreviousShapeLightParametricAngleOffset = -1;
  14. float m_PreviousShapeLightParametricRadius = -1;
  15. int m_PreviousShapePathHash = -1;
  16. LightType m_PreviousLightType = LightType.Parametric;
  17. /// <summary>
  18. /// The number of sides in the parametric shape.
  19. /// </summary>
  20. public int shapeLightParametricSides => m_ShapeLightParametricSides;
  21. /// <summary>
  22. /// The offset of the shape from the light's origin.
  23. /// </summary>
  24. public float shapeLightParametricAngleOffset => m_ShapeLightParametricAngleOffset;
  25. /// <summary>
  26. /// The size of the shape.
  27. /// </summary>
  28. public float shapeLightParametricRadius
  29. {
  30. get { return m_ShapeLightParametricRadius; }
  31. internal set { m_ShapeLightParametricRadius = value; }
  32. }
  33. /// <summary>
  34. /// The size of the fall-off area. Bigger value corresponds to bigger fall off size.
  35. /// </summary>
  36. public float shapeLightFalloffSize
  37. {
  38. get { return m_ShapeLightFalloffSize; }
  39. set { m_ShapeLightFalloffSize = Mathf.Max(0, value); }
  40. }
  41. /// <summary>
  42. /// Returns the path that represents the shape light. Values are in object space.
  43. /// </summary>
  44. public Vector3[] shapePath
  45. {
  46. get { return m_ShapePath; }
  47. internal set { m_ShapePath = value; }
  48. }
  49. /// <summary>
  50. /// Set the shape that represents the freeform light. Values are in object space.
  51. /// </summary>
  52. /// <param name="path">Array of Vector3 defining the shape.</param>
  53. public void SetShapePath(Vector3[] path)
  54. {
  55. m_ShapePath = path;
  56. }
  57. }
  58. }