URPで使えるLight2Dには、4つのLightTypeを指定できます。
- Freeform
- Sprite
- Spot
- Global
このうちLightType=Spriteを指定すると、inspectorで指定したSpriteの形のライトが作れます。


このSpriteをコード側から取得するためには lightCookieSprite
を参照すれば良さそうです。
var targetLight = GetComponent<Light2D>();
Debug.Log(targetLight.lightCookieSprite); // => plus
Class Light2D
| Package Manager UI website
コメント