[Memo-Unity] 15. setActive , enabled ์ฐจ์ด

์—…๋ฐ์ดํŠธ:

์นดํ…Œ๊ณ ๋ฆฌ:

ํƒœ๊ทธ: ,


SetActive enabled

SetActive, enabled








1. enabled

GameObject.SetActive : ์˜ค๋ธŒ์ ํŠธ๋ฅผ ํ™œ์„ฑํ™”, ๋น„ํ™œ์„ฑํ™”๋ฅผ ํ•˜๋Š” ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค.
์˜ค๋ธŒ์ ํŠธ๋ฅผ ๋น„ํ™œ์„ฑํ™” ์‹œํ‚ค๋ฉด ์˜ค๋ธŒ์ ํŠธ ์ž์ฒด๊ฐ€ ์”ฌ, ๊ฒŒ์ž„๋ทฐ์—์„œ ์‚ฌ๋ผ์ง€๊ณ  ์ž‘๋™ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

image

Behaviour.enabled : ์˜ค๋ธŒ์ ํŠธ์— ์ถ”๊ฐ€๋˜์–ด ์žˆ๋Š” ์ปดํฌ๋„ŒํŠธ๋ฅผ ํ™œ์„ฑํ™” ๋ฐ ๋น„ํ™œ์„ฑํ™”์‹œํ‚ต๋‹ˆ๋‹ค.
ํŠน์ • ๊ธฐ๋Šฅ์„ ๋งŒ๋“ค ๋•Œ ์ง€์ •ํ•œ ์ปดํฌ๋„ŒํŠธ๋งŒ ๋น„ํ™œ์„ฑํ™” ์‹œ์ผœ์„œ ๊ธฐ๋Šฅ์„ ์ž ์‹œ ์ •์ง€์‹œํ‚ค๋Š” ์šฉ๋„๋กœ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

image




[Unity] SetActive, enabled TOP


๐Ÿ“”

๋Œ“๊ธ€๋‚จ๊ธฐ๊ธฐ