Public Text xt;ย
์ด๋ ๊ฒ ์ ์ธํ๊ณ
๋ค๋ฅธํด๋์ค์์
game.Find("xt").getcomponent<ํด๋์ค์ด๋ฆ>().ํจ์์ด๋ฆ();
์ด๋ ๊ฒ ์ฐ๋๋ฐ ๊ณ์ NULLReference๋ญ๋ผ๋ญ๋ผ ์ค๋ฅ๋ธ
ํ
์คํธ ๋ณ์์ ์ธ์ NUL๊ฐ์ผ๋ก ํด์ ๊ทธ๋ฐ๊ฑฐ์ผ? ์ด๋ป๊ฒ ํด์ผํด?
- dc official App
xt๋ ๋ณ์๋ช ์ด๊ณ Find๋ ๊ฒ์์ค๋ธ์ ํธ name์ด๋๊น ๋น์ฐํ ๋ชป ์ฐพ์ง
xt๋ฅผ ์ ์ธํ ํด๋์ค๋ฅผ ์ฐธ์กฐํด์ class.xt.getcomponent ์ด๋ฐ์์ผ๋ก ๊ฐ์ ธ์์ผ์ง
ใ ใ ํ๋ฒํด๋ณผ๊ฒ์ ใฑใ - dc App
class.xt๋ถํฐ ์๋ํ๋์ - dc App
์ผ๋จ ์ฑ ํ ๊ถ ์ ์ฃผํํ์