Light2DPoint.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using UnityEngine.Scripting.APIUpdating;
  3. namespace UnityEngine.Experimental.Rendering.Universal
  4. {
  5. sealed public partial class Light2D : MonoBehaviour
  6. {
  7. public enum PointLightQuality
  8. {
  9. Fast = 0,
  10. Accurate = 1
  11. }
  12. [SerializeField] float m_PointLightInnerAngle = 360.0f;
  13. [SerializeField] float m_PointLightOuterAngle = 360.0f;
  14. [SerializeField] float m_PointLightInnerRadius = 0.0f;
  15. [SerializeField] float m_PointLightOuterRadius = 1.0f;
  16. [SerializeField] float m_PointLightDistance = 3.0f;
  17. [UnityEngine.Animations.NotKeyable]
  18. [SerializeField] PointLightQuality m_PointLightQuality = PointLightQuality.Accurate;
  19. public float pointLightInnerAngle
  20. {
  21. get => m_PointLightInnerAngle;
  22. set => m_PointLightInnerAngle = value;
  23. }
  24. public float pointLightOuterAngle
  25. {
  26. get => m_PointLightOuterAngle;
  27. set => m_PointLightOuterAngle = value;
  28. }
  29. public float pointLightInnerRadius
  30. {
  31. get => m_PointLightInnerRadius;
  32. set => m_PointLightInnerRadius = value;
  33. }
  34. public float pointLightOuterRadius
  35. {
  36. get => m_PointLightOuterRadius;
  37. set => m_PointLightOuterRadius = value;
  38. }
  39. public float pointLightDistance => m_PointLightDistance;
  40. public PointLightQuality pointLightQuality => m_PointLightQuality;
  41. private BoundingSphere GetPointLightBoundingSphere()
  42. {
  43. BoundingSphere boundingSphere;
  44. boundingSphere.radius = m_PointLightOuterRadius;
  45. boundingSphere.position = transform.position;
  46. return boundingSphere;
  47. }
  48. }
  49. }