[Unity] "Universal RP Light 2D"๋ฅผ ์Šคํฌ๋ฆฝํŠธ ์ œ์–ดํ•˜๊ธฐ

2022. 2. 20. 14:48ใ†Game Development/Unity

 

๋‹ค์Œ ๐Ÿ’ก๋„ค์ž„์ŠคํŽ˜์ด์Šค ์‚ฌ์šฉ ์„ ์–ธ์ด ํ•„์š”ํ•˜๋‹ค.

using UnityEngine.Experimental.Rendering.Universal;

 

๊ทธ๋ฆฌ๊ณ  ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค. ๋‹ค์Œ์ฒ˜๋Ÿผ GetComponent<Light2D>()๋กœ ๋ถˆ๋Ÿฌ์™€๋„ ๋˜๊ณ , ๋ณ€์ˆ˜๋ฅผ public์œผ๋กœ ์„ ์–ธํ•˜์—ฌ ์ธ์ŠคํŽ™ํ„ฐ์—์„œ ๋„ฃ์–ด์„œ ์‚ฌ์šฉํ•ด๋„ ๋œ๋‹ค.

private Light2D _light;


void Start()
{
    _light = GetComponent<Light2D>();
}

 

728x90
๋ฐ˜์‘ํ˜•