暫無描述
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.

Light2DAuthoring.cs 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System.Collections.Generic;
  2. namespace UnityEngine.Rendering.Universal
  3. {
  4. public sealed partial class Light2D
  5. {
  6. #if UNITY_EDITOR
  7. private const string s_IconsPath = "Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/";
  8. private static readonly string[] s_LightIconFileNames = new[]
  9. {
  10. "ParametricLight.png",
  11. "FreeformLight.png",
  12. "SpriteLight.png",
  13. "PointLight.png",
  14. "GlobalLight.png"
  15. };
  16. private void OnDrawGizmos()
  17. {
  18. Gizmos.color = Color.blue;
  19. Gizmos.DrawIcon(transform.position, s_IconsPath + s_LightIconFileNames[(int)m_LightType], true);
  20. }
  21. void Reset()
  22. {
  23. m_ShapePath = new Vector3[] { new Vector3(-0.5f, -0.5f), new Vector3(0.5f, -0.5f), new Vector3(0.5f, 0.5f), new Vector3(-0.5f, 0.5f) };
  24. }
  25. internal List<Vector2> GetFalloffShape()
  26. {
  27. return LightUtility.GetOutlinePath(m_ShapePath, m_ShapeLightFalloffSize);
  28. }
  29. #endif
  30. }
  31. }