Files
2026-11-01 23:39:55 +02:00

44 lines
1.2 KiB
C#

using System.Collections.Generic;
namespace UnityEngine.Rendering.Universal
{
public sealed partial class Light2D
{
#if UNITY_EDITOR
private const string s_IconsPath = "Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/";
private static readonly string[] s_LightIconFileNames = new[]
{
"ParametricLight.png",
"FreeformLight.png",
"SpriteLight.png",
"PointLight.png",
"GlobalLight.png"
};
private void OnDrawGizmos()
{
if (lightType != LightType.Provider)
{
Gizmos.color = Color.blue;
Gizmos.DrawIcon(transform.position, s_IconsPath + s_LightIconFileNames[(int)lightType], true);
}
else
{
light2DProvider.OnDrawGizmos(transform);
}
}
void Reset()
{
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) };
}
internal List<Vector2> GetFalloffShape()
{
return LightUtility.GetOutlinePath(m_ShapePath, m_ShapeLightFalloffSize);
}
#endif
}
}